Method and system using a long-term correlation difference between left and right channels for time domain down mixing a stereo sound signal into primary and secondary channels

ABSTRACT

A stereo sound signal encoding method and system for time domain down mixing right and left channels of an input stereo sound signal into primary and secondary channels, determine normalised correlations of the left channel and right channel in relation to a monophonic signal version of the sound. A long-term correlation difference is determined on the basis of the normalised correlation of the left channel and the normalized correlation of the right channel. The long-term correlation difference is converted into a factor β, and the left and right channels are mixed to produce the primary and secondary channels using the factor β, wherein the factor β determines respective contributions of the left and right channels upon production of the primary and secondary channels.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is Continuation of U.S. application Ser. No.:15/761,868 filed on Mar. 21, 2018, which is the national phase under 35U.S.C. § 371 of International Application No. PCT/CA2016/051106 filed onSep. 22, 2016, which claims priority to and benefit of U.S. ProvisionalApplication No. 62/232,589 filed on Sep. 25, 2015 and U.S. ProvisionalApplication No. 62/362,360 filed on Jul. 14, 2016, the entiredisclosures of each of which are incorporated by reference herein.

TECHNICAL FIELD

The present disclosure relates to stereo sound encoding, in particularbut not exclusively stereo speech and/or audio encoding capable ofproducing a good stereo quality in a complex audio scene at low bit-rateand low delay.

BACKGROUND

Historically, conversational telephony has been implemented withhandsets having only one transducer to output sound only to one of theuser's ears. In the last decade, users have started to use theirportable handset in conjunction with a headphone to receive the soundover their two ears mainly to listen to music but also, sometimes, tolisten to speech. Nevertheless, when a portable handset is used totransmit and receive conversational speech, the content is stillmonophonic but presented to the user's two ears when a headphone isused.

With the newest 3GPP speech coding standard as described in Reference[1], of which the full content is incorporated herein by reference, thequality of the coded sound, for example speech and/or audio that istransmitted and received through a portable handset has beensignificantly improved. The next natural step is to transmit stereoinformation such that the receiver gets as close as possible to a reallife audio scene that is captured at the other end of the communicationlink.

In audio codecs, for example as described in Reference [2], of which thefull content is incorporated herein by reference, transmission of stereoinformation is normally used.

For conversational speech codecs, monophonic signal is the norm. When astereophonic signal is transmitted, the bit-rate often needs to bedoubled since both the left and right channels are coded using amonophonic codec. This works well in most scenarios, but presents thedrawbacks of doubling the bit-rate and failing to exploit any potentialredundancy between the two channels (left and right channels).Furthermore, to keep the overall bit-rate at a reasonable level, a verylow bit-rate for each channel is used, thus affecting the overall soundquality.

A possible alternative is to use the so-called parametric stereo asdescribed in Reference [6], of which the full content is incorporatedherein by reference. Parametric stereo sends information such asinter-aural time difference (ITD) or inter-aural intensity differences(IID), for example. The latter information is sent per frequency bandand, at low bit-rate, the bit budget associated to stereo transmissionis not sufficiently high to allow these parameters to work efficiently.

Transmitting a panning factor could help to create a basic stereo effectat low bit-rate, but such a technique does nothing to preserve theambiance and presents inherent limitations. Too fast an adaptation ofthe panning factor becomes disturbing to the listener while too slow anadaptation of the panning factor does not reflect the real position ofthe speakers, which makes it difficult to obtain a good quality in caseof interfering talkers or when fluctuation of the background noise isimportant. Currently, encoding conversational stereo speech with adecent quality for all possible audio scenes requires a minimum bit-rateof around 24 kb/s for wideband (WB) signals; below that bit-rate, thespeech quality starts to suffer.

With the ever increasing globalization of the workforce and splitting ofwork teams over the globe, there is a need for improvement of thecommunications. For example, participants to a teleconference may be indifferent and distant locations. Some participants could be in theircars, others could be in a large anechoic room or even in their livingroom. In fact, all participants wish to feel like they have aface-to-face discussion. Implementing stereo speech, more generallystereo sound in portable devices would be a great step in thisdirection.

SUMMARY

According to a first aspect, the present disclosure is concerned with amethod implemented in a stereo sound signal encoding system for timedomain down mixing right and left channels of an input stereo soundsignal into primary and secondary channels. According to this method,normalised correlations of the left channel and right channel aredetermined in relation to a monophonic signal version of the sound, along-term correlation difference is determined on the basis of thenormalised correlation of the left channel and the normalisedcorrelation of the right channel, the long-term correlation differenceis converted into a factor β, and the left and right channels are mixedto produce the primary and secondary channels using the factor β. Thefactor β determines respective contributions of the left and rightchannels upon production of the primary and secondary channels.

According to a second aspect, there is provided a system for time domaindown mixing right and left channels of an input stereo sound signal intoprimary and secondary channels, comprising: a normalised correlationanalyzer for determining normalised correlations of the left channel andright channel in relation to a monophonic signal version of the sound; acalculator of a long-term correlation difference on the basis of thenormalised correlation of the left channel and the normalisedcorrelation of the right channel; a converter of the long-termcorrelation difference into a factor β; and a mixer of the left andright channels to produce the primary and secondary channels using thefactor β, wherein the factor β determines respective contributions ofthe left and right channels upon production of the primary and secondarychannels.

According to a third aspect, there is provided a system for time domaindown mixing right and left channels of an input stereo sound signal intoprimary and secondary channels, comprising: at least one processor; anda memory coupled to the processor and comprising non-transitoryinstructions that when executed cause the processor to implement: anormalized correlation analyzer for determining normalized correlationsof the left channel and right channel in relation to a monophonic signalversion of the sound; a calculator of a long-term correlation differenceon the basis of the normalized correlation of the left channel and thenormalized correlation of the right channel; a converter of thelong-term correlation difference into a factor β; and a mixer of theleft and right channels to produce the primary and secondary channelsusing the factor β, wherein the factor β determines respectivecontributions of the left and right channels upon production of theprimary and secondary channels.

A further aspect is concerned with a system for time domain down mixingright and left channels of an input stereo sound signal into primary andsecondary channels, comprising: at least one processor; and a memorycoupled to the processor and comprising non-transitory instructions thatwhen executed cause the processor to: determine normalized correlationsof the left channel and right channels in relation to a monophonicsignal version of the sound; calculate a long-term correlationdifference on the basis of the normalized correlation of the leftchannel and the normalized correlation of the right channel; convert thelong-term correlation difference into a factor β; and mix the left andright channels to produce the primary and secondary channels using thefactor β, wherein the factor β determines respective contributions ofthe left and right channels upon production of the primary and secondarychannels.

The present disclosure still further relates to a processor-readablememory comprising non-transitory instructions that, when executed, causea processor to implement the operations of the above described method.

The foregoing and other objects, advantages and features of the methodand system for time domain down mixing right and left channels of aninput stereo sound signal into primary and secondary channels willbecome more apparent upon reading of the following non-restrictivedescription of illustrative embodiments thereof, given by way of exampleonly with reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

In the appended drawings:

FIG. 1 is a schematic block diagram of a stereo sound processing andcommunication system depicting a possible context of implementation ofstereo sound encoding method and system as disclosed in the followingdescription;

FIG. 2 is a block diagram illustrating concurrently a stereo soundencoding method and system according to a first model, presented as anintegrated stereo design;

FIG. 3 is a block diagram illustrating concurrently a stereo soundencoding method and system according to a second model, presented as anembedded model;

FIG. 4 is a block diagram showing concurrently sub-operations of a timedomain down mixing operation of the stereo sound encoding method ofFIGS. 2 and 3, and modules of a channel mixer of the stereo soundencoding system of FIGS. 2 and 3;

FIG. 5 is a graph showing how a linearized long-term correlationdifference is mapped to a factor β and to an energy normalization factorε;

FIG. 6 is a multiple-curve graph showing a difference between using apca/klt scheme over an entire frame and using a “cosine” mappingfunction;

FIG. 7 is a multiple-curve graph showing a primary channel, a secondarychannel and the spectrums of these primary and secondary channelsresulting from applying time domain down mixing to a stereo sample thathas been recorded in a small echoic room using a binaural microphonessetup with office noise in background;

FIG. 8 is a block diagram illustrating concurrently a stereo soundencoding method and system, with a possible implementation ofoptimization of the encoding of both the primary Y and secondary Xchannels of the stereo sound signal;

FIG. 9 is a block diagram illustrating an LP filter coherence analysisoperation and corresponding LP filter coherence analyzer of the stereosound encoding method and system of FIG. 8;

FIG. 10 is a block diagram illustrating concurrently a stereo sounddecoding method and stereo sound decoding system;

FIG. 11 is a block diagram illustrating additional features of thestereo sound decoding method and system of FIG. 10;

FIG. 12 is a simplified block diagram of an example configuration ofhardware components forming the stereo sound encoding system and thestereo sound decoder of the present disclosure;

FIG. 13 is a block diagram illustrating concurrently other embodimentsof sub-operations of the time domain down mixing operation of the stereosound encoding method of FIGS. 2 and 3, and modules of the channel mixerof the stereo sound encoding system of FIGS. 2 and 3, using apre-adaptation factor to enhance stereo image stability;

FIG. 14 is a block diagram illustrating concurrently operations of atemporal delay correction and modules of a temporal delay corrector;

FIG. 15 is a block diagram illustrating concurrently an alternativestereo sound encoding method and system;

FIG. 16 is a block diagram illustrating concurrently sub-operations of apitch coherence analysis and modules of a pitch coherence analyzer;

FIG. 17 is a block diagram illustrating concurrently stereo encodingmethod and system using time-domain down mixing with a capability ofoperating in the time-domain and in the frequency domain; and

FIG. 18 is a block diagram illustrating concurrently other stereoencoding method and system using time-domain down mixing with acapability of operating in the time-domain and in the frequency domain.

DETAILED DESCRIPTION

The present disclosure is concerned with production and transmission,with a low bit-rate and low delay, of a realistic representation ofstereo sound content, for example speech and/or audio content, from, inparticular but not exclusively, a complex audio scene. A complex audioscene includes situations in which (a) the correlation between the soundsignals that are recorded by the microphones is low, (b) there is animportant fluctuation of the background noise, and/or (c) an interferingtalker is present. Examples of complex audio scenes comprise a largeanechoic conference room with an NB microphones configuration, a smallechoic room with binaural microphones, and a small echoic room with amono/side microphones set-up. All these room configurations couldinclude fluctuating background noise and/or interfering talkers.

Known stereo sound codecs, such as 3GPP AMR-WB+ as described inReference [7], of which the full content is incorporated herein byreference, are inefficient for coding sound that is not close to themonophonic model, especially at low bit-rate. Certain cases areparticularly difficult to encode using existing stereo techniques. Suchcases include:

-   -   LAAB (Large anechoic room with NB microphones set-up);    -   SEBI (Small echoic room with binaural microphones set-up); and    -   SEMS (Small echoic room with Mono/Side microphones setup).

Adding a fluctuating background noise and/or interfering talkers makesthese sound signals even harder to encode at low bit-rate using stereodedicated techniques, such as parametric stereo. A fall back to encodesuch signals is to use two monophonic channels, hence doubling thebit-rate and network bandwidth being used.

The latest 3GPP EVS conversational speech standard provides a bit-raterange from 7.2 kb/s to 96 kb/s for wideband (WB) operation and 9.6 kb/sto 96 kb/s for super wideband (SWB) operation. This means that the threelowest dual mono bit-rates using EVS are 14.4, 16.0 and 19.2 kb/s for WBoperation and 19.2, 26.3 and 32.8 kb/s for SWB operation. Althoughspeech quality of the deployed 3GPP AMR-WB as described in Reference[3], of which the full content is incorporated herein by reference,improves over its predecessor codec, the quality of the coded speech at7.2 kb/s in noisy environment is far from being transparent and,therefore, it can be anticipated that the speech quality of dual mono at14.4 kb/s would also be limited. At such low bit-rates, the bit-rateusage is maximized such that the best possible speech quality isobtained as often as possible. With the stereo sound encoding method andsystem as disclosed in the following description, the minimum totalbit-rate for conversational stereo speech content, even in case ofcomplex audio scenes, should be around 13 kb/s for WB and 15.0 kb/s forSWB. At bit-rates that are lower than the bit-rates used in a dual monoapproach, the quality and the intelligibility of stereo speech isgreatly improved for complex audio scenes.

FIG. 1 is a schematic block diagram of a stereo sound processing andcommunication system 100 depicting a possible context of implementationof the stereo sound encoding method and system as disclosed in thefollowing description.

The stereo sound processing and communication system 100 of FIG. 1supports transmission of a stereo sound signal across a communicationlink 101. The communication link 101 may comprise, for example, a wireor an optical fiber link. Alternatively, the communication link 101 maycomprise at least in part a radio frequency link. The radio frequencylink often supports multiple, simultaneous communications requiringshared bandwidth resources such as may be found with cellular telephony.Although not shown, the communication link 101 may be replaced by astorage device in a single device implementation of the processing andcommunication system 100 that records and stores the encoded stereosound signal for later playback.

Still referring to FIG. 1, for example a pair of microphones 102 and 122produces the left 103 and right 123 channels of an original analogstereo sound signal detected, for example, in a complex audio scene. Asindicated in the foregoing description, the sound signal may comprise,in particular but not exclusively, speech and/or audio. The microphones102 and 122 may be arranged according to an NB, binaural or Mono/sideset-up.

The left 103 and right 123 channels of the original analog sound signalare supplied to an analog-to-digital (ND) converter 104 for convertingthem into left 105 and right 125 channels of an original digital stereosound signal. The left 105 and right 125 channels of the originaldigital stereo sound signal may also be recorded and supplied from astorage device (not shown).

A stereo sound encoder 106 encodes the left 105 and right 125 channelsof the digital stereo sound signal thereby producing a set of encodingparameters that are multiplexed under the form of a bitstream 107delivered to an optional error-correcting encoder 108. The optionalerror-correcting encoder 108, when present, adds redundancy to thebinary representation of the encoding parameters in the bitstream 107before transmitting the resulting bitstream 111 over the communicationlink 101.

On the receiver side, an optional error-correcting decoder 109 utilizesthe above mentioned redundant information in the received digitalbitstream 111 to detect and correct errors that may have occurred duringtransmission over the communication link 101, producing a bitstream 112with received encoding parameters. A stereo sound decoder 110 convertsthe received encoding parameters in the bitstream 112 for creatingsynthesized left 113 and right 133 channels of the digital stereo soundsignal. The left 113 and right 133 channels of the digital stereo soundsignal reconstructed in the stereo sound decoder 110 are converted tosynthesized left 114 and right 134 channels of the analog stereo soundsignal in a digital-to-analog (D/A) converter 115.

The synthesized left 114 and right 134 channels of the analog stereosound signal are respectively played back in a pair of loudspeaker units116 and 136. Alternatively, the left 113 and right 133 channels of thedigital stereo sound signal from the stereo sound decoder 110 may alsobe supplied to and recorded in a storage device (not shown).

The left 105 and right 125 channels of the original digital stereo soundsignal of FIG. 1 corresponds to the left L and right R channels of FIGS.2, 3, 4, 8, 9, 13, 14, 15, 17 and 18. Also, the stereo sound encoder 106of FIG. 1 corresponds to the stereo sound encoding system of FIGS. 2, 3,8, 15, 17 and 18.

The stereo sound encoding method and system in accordance with thepresent disclosure are two-fold; first and second models are provided.

FIG. 2 is a block diagram illustrating concurrently the stereo soundencoding method and system according to the first model, presented as anintegrated stereo design based on the EVS core.

Referring to FIG. 2, the stereo sound encoding method according to thefirst model comprises a time domain down mixing operation 201, a primarychannel encoding operation 202, a secondary channel encoding operation203, and a multiplexing operation 204.

To perform the time-domain down mixing operation 201, a channel mixer251 mixes the two input stereo channels (right channel R and leftchannel L) to produce a primary channel Y and a secondary channel X.

To carry out the secondary channel encoding operation 203, a secondarychannel encoder 253 selects and uses a minimum number of bits (minimumbit-rate) to encode the secondary channel X using one of the encodingmodes as defined in the following description and produce acorresponding secondary channel encoded bitstream 206. The associatedbit budget may change every frame depending on frame content.

To implement the primary channel encoding operation 202, a primarychannel encoder 252 is used. The secondary channel encoder 253 signalsto the primary channel encoder 252 the number of bits 208 used in thecurrent frame to encode the secondary channel X. Any suitable type ofencoder can be used as the primary channel encoder 252. As anon-limitative example, the primary channel encoder 252 can be aCELP-type encoder. In this illustrative embodiment, the primary channelCELP-type encoder is a modified version of the legacy EVS encoder, wherethe EVS encoder is modified to present a greater bitrate scalability toallow flexible bit rate allocation between the primary and secondarychannels. In this manner, the modified EVS encoder will be able to useall the bits that are not used to encode the secondary channel X forencoding, with a corresponding bit-rate, the primary channel Y andproduce a corresponding primary channel encoded bitstream 205.

A multiplexer 254 concatenates the primary channel bitstream 205 and thesecondary channel bitstream 206 to form a multiplexed bitstream 207, tocomplete the multiplexing operation 204.

In the first model, the number of bits and corresponding bit-rate (inthe bitstream 206) used to encode the secondary channel X is smallerthan the number of bits and corresponding bit-rate (in the bitstream205) used to encode the primary channel Y. This can be seen as two (2)variable-bit-rate channels wherein the sum of the bit-rates of the twochannels X and Y represents a constant total bit-rate. This approach mayhave different flavors with more or less emphasis on the primary channelY. According to a first example, when a maximum emphasis is put on theprimary channel Y, the bit budget of the secondary channel X isaggressively forced to a minimum. According to a second example, if lessemphasis is put on the primary channel Y, then the bit budget for thesecondary channel X may be made more constant, meaning that the averagebit-rate of the secondary channel X is slightly higher compared to thefirst example.

It is reminded that the right R and left L channels of the input digitalstereo sound signal are processed by successive frames of a givenduration which may corresponds to the duration of the frames used in EVSprocessing. Each frame comprises a number of samples of the right R andleft L channels depending on the given duration of the frame and thesampling rate being used.

FIG. 3 is a block diagram illustrating concurrently the stereo soundencoding method and system according to the second model, presented asan embedded model.

Referring to FIG. 3, the stereo sound encoding method according to thesecond model comprises a time domain down mixing operation 301, aprimary channel encoding operation 302, a secondary channel encodingoperation 303, and a multiplexing operation 304.

To complete the time domain down mixing operation 301, a channel mixer351 mixes the two input right R and left L channels to form a primarychannel Y and a secondary channel X.

In the primary channel encoding operation 302, a primary channel encoder352 encodes the primary channel Y to produce a primary channel encodedbitstream 305. Again, any suitable type of encoder can be used as theprimary channel encoder 352. As a non-limitative example, the primarychannel encoder 352 can be a CELP-type encoder. In this illustrativeembodiment, the primary channel encoder 352 uses a speech codingstandard such as the legacy EVS mono encoding mode or the AMR-WB-IOencoding mode, for instance, meaning that the monophonic portion of thebitstream 305 would be interoperable with the legacy EVS, the AMR-WB-IOor the legacy AMR-WB decoder when the bit-rate is compatible with suchdecoder. Depending on the encoding mode being selected, some adjustmentof the primary channel Y may be required for processing through theprimary channel encoder 352.

In the secondary channel encoding operation 303, a secondary channelencoder 353 encodes the secondary channel X at lower bit-rate using oneof the encoding modes as defined in the following description. Thesecondary channel encoder 353 produces a secondary channel encodedbitstream 306.

To perform the multiplexing operation 304, a multiplexer 354concatenates the primary channel encoded bitstream 305 with thesecondary channel encoded bitstream 306 to form a multiplexed bitstream307. This is called an embedded model, because the secondary channelencoded bitstream 306 associated to stereo is added on top of aninter-operable bitstream 305. The secondary channel bitstream 306 can bestripped-off the multiplexed stereo bitstream 307 (concatenatedbitstreams 305 and 306) at any moment resulting in a bitstream decodableby a legacy codec as described herein above, while a user of a newestversion of the codec would still be able to enjoy the complete stereodecoding.

The above described first and second models are in fact close one toanother. The main difference between the two models is the possibilityto use a dynamic bit allocation between the two channels Y and X in thefirst model, while bit allocation is more limited in the second modeldue to interoperability considerations.

Examples of implementation and approaches used to achieve the abovedescribed first and second models are given in the followingdescription.

1) Time Domain Down Mixing

As expressed in the foregoing description, the known stereo modelsoperating at low bit-rate have difficulties with coding speech that isnot close to the monophonic model. Traditional approaches perform downmixing in the frequency domain, per frequency band, using for example acorrelation per frequency band associated with a Principal ComponentAnalysis (pca) using for example a Karhunen-Loève Transform (klt), toobtain two vectors, as described in references [4] and [5], of which thefull contents are herein incorporated by reference. One of these twovectors incorporates all the highly correlated content while the othervector defines all content that is not much correlated. The best knownmethod to encode speech at low-bit rates uses a time domain codec, suchas a CELP (Code-Excited Linear Prediction) codec, in which knownfrequency-domain solutions are not directly applicable. For that reason,while the idea behind the pca/klt per frequency band is interesting,when the content is speech, the primary channel Y needs to be convertedback to time domain and, after such conversion, its content no longerlooks like traditional speech, especially in the case of the abovedescribed configurations using a speech-specific model such as CELP.This has the effect of reducing the performance of the speech codec.Moreover, at low bit-rate, the input of a speech codec should be asclose as possible to the codec's inner model expectations.

Starting with the idea that an input of a low bit-rate speech codecshould be as close as possible to the expected speech signal, a firsttechnique has been developed. The first technique is based on anevolution of the traditional pca/klt scheme. While the traditionalscheme computes the pca/klt per frequency band, the first techniquecomputes it over the whole frame, directly in the time domain. Thisworks adequately during active speech segments, provided there is nobackground noise or interfering talker. The pca/klt scheme determineswhich channel (left L or right R channel) contains the most usefulinformation, this channel being sent to the primary channel encoder.Unfortunately, the pca/klt scheme on a frame basis is not reliable inthe presence of background noise or when two or more persons are talkingwith each other. The principle of the pca/klt scheme involves selectionof one input channel (R or L) or the other, often leading to drasticchanges in the content of the primary channel to be encoded. At leastfor the above reasons, the first technique is not sufficiently reliableand, accordingly, a second technique is presented herein for overcomingthe deficiencies of the first technique and allow for a smoothertransition between the input channels. This second technique will bedescribed hereinafter with reference to FIGS. 4-9.

Referring to FIG. 4, the operation of time domain down mixing 201/301(FIGS. 2 and 3) comprises the following sub-operations: an energyanalysis sub-operation 401, an energy trend analysis sub-operation 402,an L and R channel normalized correlation analysis sub-operation 403, along-term (LT) correlation difference calculating sub-operation 404, along-term correlation difference to factor β conversion and quantizationsub-operation 405 and a time domain down mixing sub-operation 406.

Keeping in mind the idea that the input of a low bit-rate sound (such asspeech and/or audio) codec should be as homogeneous as possible, theenergy analysis sub-operation 401 is performed in the channel mixer252/351 by an energy analyzer 451 to first determine, by frame, the rms(Root Mean Square) energy of each input channel R and L using relations(1):

$\begin{matrix}{{{{{rms}_{L}(t)} = \sqrt{\frac{\sum_{i = 0}^{N - 1}{L(i)}^{2}}{N}}};{{{rms}_{R}(t)} = \sqrt{\frac{\sum_{i = 0}^{N - 1}{R(i)}^{2}}{N}}}},} & (1)\end{matrix}$

where the subscripts L and R stand for the left and right channelsrespectively, L(i) stands for sample i of channel L, R(i) stands forsample i of channel R, N corresponds to the number of samples per frame,and t stands for a current frame.

The energy analyzer 451 then uses the rms values of relations (1) todetermine long-term rms values rms for each channel using relations (2):rms _(L)(t)=0.6·rms _(L)(t ⁻¹)+0.4·rms _(L); rms _(R)(t)=0.6·rms _(R)(t⁻¹)+0.4·rms_(R),  (2)

where t represents the current frame and t⁻¹ the previous frame.

To perform the energy trend analysis sub-operation 402, an energy trendanalyzer 452 of the channel mixer 251/351 uses the long-term rms valuesrms to determine the trend of the energy in each channel L and R rms_dtusing relations (3):rms_dt _(L)=rms _(L)(t)−rms _(L)(t ⁻¹); rms_dt _(R)=rms _(R)(t)−rms_(R)(t ⁻¹).  (3)

The trend of the long-term rms values is used as information that showsif the temporal events captured by the microphones are fading-out or ifthey are changing channels. The long-term rms values and their trend arealso used to determine a speed of convergence a of αlong-termcorrelation difference as will be described herein after.

To perform the channels L and R normalized correlation analysissub-operation 403, an L and R normalized correlation analyzer 453computes a correlation G_(L|R) for each of the left L and right Rchannels normalized against a monophonic signal version m(i) of thesound, such as speech and/or audio, in the frame t using relations (4):

$\begin{matrix}{{{G_{L}(t)} = \frac{\sum_{i = 0}^{N - 1}\mspace{14mu}( {{L(i)} \cdot {m(i)}} )}{\sum_{i = 0}^{N - 1}\mspace{14mu}{m(i)}^{2}}},{{G_{R}(t)} = \frac{\sum_{i = 0}^{N - 1}\mspace{14mu}( {{R(i)} \cdot {m(i)}} )}{\sum_{i = 0}^{N - 1}\mspace{14mu}{m(i)}^{2}}},{{m(i)} = ( \frac{{L(i)} + {R(i)}}{2} )},} & (4)\end{matrix}$

where N, as already mentioned, corresponds to the number of samples in aframe, and t stands for the current frame. In the current embodiment,all normalized correlations and rms values determined by relations 1 to4 are calculated in the time domain, for the whole frame. In anotherpossible configuration, these values can be computed in the frequencydomain. For instance, the techniques described herein, which are adaptedto sound signals having speech characteristics, can be part of a largerframework which can switch between a frequency domain generic stereoaudio coding method and the method described in the present disclosure.In this case computing the normalized correlations and rms values in thefrequency domain may present some advantage in terms of complexity orcode re-use.

To compute the long-term (LT) correlation difference in sub-operation404, a calculator 454 computes for each channel L and R in the currentframe smoothed normalized correlations using relations (5):G _(L) (t)=∝· G _(L) (t ⁻¹)+(1−∝)·G _(L)(t) and G _(R) (t)=∝· G _(R) (t⁻¹)+(1−∝)·G _(R)(t),  (5)

where α is the above mentioned speed of convergence. Finally, thecalculator 454 determines the long-term (LT) correlation differenceG_(LR) using relation (6):G _(LR) (t)= G _(L) (t)− G _(R) (t).  (6)

In one example embodiment, the speed of convergence a may have a valueof 0.8 or 0.5 depending on the long-term energies computed in relations(2) and the trend of the long-term energies as computed in relations(3). For instance, the speed of convergence a may have a value of 0.8when the long-term energies of the left L and right R channels evolve ina same direction, a difference between the long-term correlationdifference G_(LR) at frame t and the long-term correlation differenceG_(LR) at frame t⁻¹ is low (below 0.31 for this example embodiment), andat least one of the long-term rms values of the left L and right Rchannels is above a certain threshold (2000 in this example embodiment).Such cases mean that both channels L and R are evolving smoothly, thereis no fast change in energy from one channel to the other, and at leastone channel contains a meaningful level of energy. Otherwise, when thelong-term energies of the right R and left L channels evolve indifferent directions, when the difference between the long-termcorrelation differences is high, or when the two right R and left Lchannels have low energies, then a will be set to 0.5 to increase aspeed of adaptation of the long-term correlation difference G_(LR) .

To carry out the conversion and quantization sub-operation 405, once thelong-term correlation difference G_(LR) has been properly estimated incalculator 454, the converter and quantizer 455 converts this differenceinto a factor β that is quantized, and supplied to (a) the primarychannel encoder 252 (FIG. 2), (b) the secondary channel encoder 253/353(FIGS. 2 and 3), and (c) the multiplexer 254/354 (FIGS. 2 and 3) fortransmission to a decoder within the multiplexed bitstream 207/307through a communication link such as 101 of FIG. 1.

The factor β represents two aspects of the stereo input combined intoone parameter. First, the factor β represents a proportion orcontribution of each of the right R and left L channels that arecombined together to create the primary channel Y and, second, it canalso represent an energy scaling factor to apply to the primary channelY to obtain a primary channel that is close in the energy domain to whata monophonic signal version of the sound would look like. Thus, in thecase of an embedded structure, it allows the primary channel Y to bedecoded alone without the need to receive the secondary bitstream 306carrying the stereo parameters. This energy parameter can also be usedto rescale the energy of the secondary channel X before encodingthereof, such that the global energy of the secondary channel X iscloser to the optimal energy range of the secondary channel encoder. Asshown on FIG. 2, the energy information intrinsically present in thefactor β may also be used to improve the bit allocation between theprimary and the secondary channels.

The quantized factor β may be transmitted to the decoder using an index.Since the factor β can represent both (a) respective contributions ofthe left and right channels to the primary channel and (b) an energyscaling factor to apply to the primary channel to obtain a monophonicsignal version of the sound or a correlation/energy information thathelps to allocate more efficiently the bits between the primary channelY and the secondary channel X, the index transmitted to the decoderconveys two distinct information elements with a same number of bits.

To obtain a mapping between the long-term correlation differenceG_(LR)(t) and the factor β, in this example embodiment, the converterand quantizer 455 first limits the long-term correlation differenceG_(LR)(t) between −1.5 to 1.5 and then linearizes this long-termcorrelation difference between 0 and 2 to get a temporary linearizedlong-term correlation difference G_(LR)′(t) as shown by relation (7):

$\begin{matrix}{{G_{LR}^{\prime}(t)} = \{ \begin{matrix}{0,} & {\overset{\_}{G_{LR}(t)} \leq {- 1.5}} \\{{{\frac{2}{3} \cdot \overset{\_}{G_{LR}(t)}} + 1.0},} & {{- 1.5} < \overset{\_}{G_{LR}(t)} < 1.5} \\{2,} & {\overset{\_}{G_{LR}(t)} \geq 1.5}\end{matrix} } & (7)\end{matrix}$

In an alternative implementation, it may be decided to use only a partof the space filled with the linearized long-term correlation differenceG_(LR)′(t), by further limiting its values between, for example, 0.4 and0.6. This additional limitation would have the effect to reduce thestereo image localization, but to also save some quantization bits.Depending on the design choice, this option can be considered.

After the linearization, the converter and quantizer 455 performs amapping of the linearized long-term correlation difference G_(LR)′(t)into the “cosine” domain using relation (8):

$\begin{matrix}{{\beta(t)} = {\frac{1}{2} \cdot ( {1 - {\cos\mspace{11mu}( {\pi \cdot \frac{G_{LR}^{\prime}(t)}{2}} )}} )}} & (8)\end{matrix}$

To perform the time domain down mixing sub-operation 406, a time domaindown mixer 456 produces the primary channel Y and the secondary channelX as a mixture of the right R and left L channels using relations (9)and (10):Y(i)=R(i)·(1−β(t))+L(i)·β(t)  (9)X(i)=L(i)·(1−β(t))−R(i)·β(t)  (10)

where i=0, . . . , N−1 is the sample index in the frame and t is theframe index.

FIG. 13 is a block diagram showing concurrently other embodiments ofsub-operations of the time domain down mixing operation 201/301 of thestereo sound encoding method of FIGS. 2 and 3, and modules of thechannel mixer 251/351 of the stereo sound encoding system of FIGS. 2 and3, using a pre-adaptation factor to enhance stereo image stability. Inan alternative implementation as represented in FIG. 13, the time domaindown mixing operation 201/301 comprises the following sub-operations: anenergy analysis sub-operation 1301, an energy trend analysissub-operation 1302, an L and R channel normalized correlation analysissub-operation 1303, a pre-adaptation factor computation sub-operation1304, an operation 1305 of applying the pre-adaptation factor tonormalized correlations, a long-term (LT) correlation differencecomputation sub-operation 1306, a gain to factor β conversion andquantization sub-operation 1307, and a time domain down mixingsub-operation 1308.

The sub-operations 1301, 1302 and 1303 are respectively performed by anenergy analyzer 1351, an energy trend analyzer 1352 and an L and Rnormalized correlation analyzer 1353, substantially in the same manneras explained in the foregoing description in relation to sub-operations401, 402 and 403, and analyzers 451, 452 and 453 of FIG. 4.

To perform sub-operation 1305, the channel mixer 251/351 comprises acalculator 1355 for applying the pre-adaptation factor α_(r) directly tothe correlations G_(L|R)) (G_(L)(t) and G_(R)(t)) from relations (4)such that their evolution is smoothed depending on the energy and thecharacteristics of both channels. If the energy of the signal is low orif it has some unvoiced characteristics, then the evolution of thecorrelation gain can be slower.

To carry out the pre-adaptation factor computation sub-operation 1304,the channel mixer 251/351 comprises a pre-adaptation factor calculator1354, supplied with (a) the long term left and right channel energyvalues of relations (2) from the energy analyzer 1351, (b) frameclassification of previous frames and (c) voice activity information ofthe previous frames. The pre-adaptation factor calculator 1354 computesthe pre-adaptation factor α_(r), which may be linearized between 0.1 and1 depending on the minimum long term rms values rms _(L|R) of the leftand right channels from analyzer 1351, using relation (6a):α_(r)=max(min(M _(α)·min(rms _(L)(t),rms _(R)(t)+B _(α),1),0.1),  (11a)

In an embodiment, coefficient M_(a) may have the value of 0.0009 andcoefficient B_(α) the value of 0.16. In a variant, the pre-adaptationfactor α_(r) may be forced to 0.15, for example, if a previousclassification of the two channels R and L is indicative of unvoicedcharacteristics and of an active signal. A voice activity detection(VAD) hangover flag may also be used to determine that a previous partof the content of a frame was an active segment.

The operation 1305 of applying the pre-adaptation factor α_(r) to thenormalized correlations G_(L|R) (G_(L)(t) and G_(R)(t) from relations(4)) of the left L and right R channels is distinct from the operation404 of FIG. 4. Instead of calculating long term (LT) smoothed normalizedcorrelations by applying to the normalized correlations G_(L|R)(G_(L)(t) and G_(R)(t)) a factor (1−α), α being the above defined speedof convergence (Relations (5)), the calculator 1355 applies thepre-adaptation factor α_(r) directly to the normalized correlationsG_(L|R) (G_(L)(t) and G_(R)(t)) of the left L and right R channels usingrelation (11b):τ_(L)(t)=α_(r) ·G _(L)(t)+(1−α_(r))· G _(L) (t) and τ_(R)(t)=α_(r) ·G_(R)(t)+(1−α_(r))· G _(R) (t).  (11b)

The calculator 1355 outputs adapted correlation gains τ_(L|R) that areprovided to a calculator of long-term (LT) correlation differences 1356.The operation of time domain down mixing 201/301 (FIGS. 2 and 3)comprises, in the implementation of FIG. 13, a long-term (LT)correlation difference calculating sub-operation 1306, a long-termcorrelation difference to factor β conversion and quantizationsub-operation 1307 and a time domain down mixing sub-operation 1358similar to the sub-operations 404, 405 and 406, respectively, of FIG. 4.

The operation of time domain down mixing 201/301 (FIGS. 2 and 3)comprises, in the implementation of FIG. 13, a long-term (LT)correlation difference calculating sub-operation 1306, a long-termcorrelation difference to factor β conversion and quantizationsub-operation 1307 and a time domain down mixing sub-operation 1358similar to the sub-operations 404, 405 and 406, respectively, of FIG. 4.

The sub-operations 1306, 1307 and 1308 are respectively performed by acalculator 1356, a converter and quantizer 1357 and time domain downmixer 1358, substantially in the same manner as explained in theforegoing description in relation to sub-operations 404, 405 and 406,and the calculator 454, converter and quantizer 455 and time domain downmixer 456.

FIG. 5 shows how the linearized long-term correlation differenceG_(LR)′(t) is mapped to the factor β and the energy scaling. It can beobserved that for a linearized long-term correlation differenceG_(LR)′(t) of 1.0, meaning that the right R and left L channelenergies/correlations are almost the same, the factor β is equal to 0.5and an energy normalization (rescaling) factor ε is 1.0. In thissituation, the content of the primary channel Y is basically a monomixture and the secondary channel X forms a side channel. Calculation ofthe energy normalization (rescaling) factor ε is described hereinbelow.

On the other hand, if the linearized long-term correlation differenceG_(LR)′(t) is equal to 2, meaning that most of the energy is in the leftchannel L, then the factor β is 1 and the energy normalization(rescaling) factor is 0.5, indicating that the primary channel Ybasically contains the left channel L in an integrated designimplementation or a downscaled representation of the left channel L inan embedded design implementation. In this case, the secondary channel Xcontains the right channel R. In the example embodiments, the converterand quantizer 455 or 1357 quantizes the factor β using 31 possiblequantization entries. The quantized version of the factor β isrepresented using a 5 bits index and, as described hereinabove, issupplied to the multiplexer for integration into the multiplexedbitstream 207/307, and transmitted to the decoder through thecommunication link.

In an embodiment, the factor β may also be used as an indicator for boththe primary channel encoder 252/352 and the secondary channel encoder253/353 to determine the bit-rate allocation. For example, if the βfactor is close to 0.5, meaning that the two (2) input channelenergies/correlation to the mono are close to each other, more bitswould be allocated to the secondary channel X and less bits to theprimary channel Y, except if the content of both channels is prettyclose, then the content of the secondary channel will be really lowenergy and likely be considered as inactive, thus allowing very few bitsto code it. On the other hand, if the factor β is closer to 0 or 1, thenthe bit-rate allocation will favor the primary channel Y.

FIG. 6 shows the difference between using the above mentioned pca/kltscheme over the entire frame (two top curves of FIG. 6) versus using the“cosine” function as developed in relation (8) to compute the factor β(bottom curve of FIG. 6). By nature the pca/klt scheme tends to searchfor a minimum or a maximum. This works well in case of active speech asshown by the middle curve of FIG. 6, but this does not work really wellfor speech with background noise as it tends to continuously switch from0 to 1 as shown by the middle curve of FIG. 6. Too frequent switching toextremities, 0 and 1, causes lots of artefacts when coding at lowbit-rate. A potential solution would have been to smooth out thedecisions of the pca/klt scheme, but this would have negatively impactedthe detection of speech bursts and their correct locations while the“cosine” function of relation (8) is more efficient in this respect.

FIG. 7 shows the primary channel Y, the secondary channel X and thespectrums of these primary Y and secondary X channels resulting fromapplying time domain down mixing to a stereo sample that has beenrecorded in a small echoic room using a binaural microphones setup withoffice noise in background. After the time domain down mixing operation,it can be seen that both channels still have similar spectrum shapes andthe secondary channel X still has a speech like temporal content, thuspermitting to use a speech based model to encode the secondary channelX.

The time domain down mixing presented in the foregoing description mayshow some issues in the special case of right R and left L channels thatare inverted in phase. Summing the right R and left L channels to obtaina monophonic signal would result in the right R and left L channelscancelling each other. To solve this possible issue, in an embodiment,channel mixer 251/351 compares the energy of the monophonic signal tothe energy of both the right R and left L channels. The energy of themonophonic signal should be at least greater than the energy of one ofthe right R and left L channels. Otherwise, in this embodiment, the timedomain down mixing model enters the inverted phase special case. In thepresence of this special case, the factor β is forced to 1 and thesecondary channel X is forcedly encoded using generic or unvoiced mode,thus preventing the inactive coding mode and ensuring proper encoding ofthe secondary channel X. This special case, where no energy rescaling isapplied, is signaled to the decoder by using the last bits combination(index value) available for the transmission of the factor β (Basicallysince β is quantized using 5 bits and entries (quantization levels) areused for quantization as described hereinabove, the 32^(th) possible bitcombination (entry or index value) is used for signaling this specialcase).

In an alternative implementation, more emphasis may be put on thedetection of signals that are suboptimal for the down mixing and codingtechniques described hereinabove, such as in cases of out-of-phase ornear out-of-phase signals. Once these signals are detected, theunderlying coding techniques may be adapted if needed.

Typically, for time domain down mixing as described herein, when theleft L and right R channels of an input stereo signal are out-of-phase,some cancellation may happen during the down mixing process, which couldlead to a suboptimal quality. In the above examples, the detection ofthese signals is simple and the coding strategy comprises encoding bothchannels separately. But sometimes, with special signals, such assignals that are out-of-phase, it may be more efficient to still performa down mixing similar to mono/side (β=0.5), where a greater emphasis isput on the side channel. Given that some special treatment of thesesignals may be beneficial, the detection of such signals needs to beperformed carefully. Furthermore, transition from the normal time domaindown mixing model as described in the foregoing description and the timedomain down mixing model that is dealing with these special signals maybe triggered in very low energy region or in regions where the pitch ofboth channels is not stable, such that the switching between the twomodels has a minimal subjective effect.

Temporal delay correction (TDC) (see temporal delay corrector 1750 inFIGS. 17 and 18) between the L and R channels, or a technique similar towhat is described in reference [8], of which the full content isincorporated herein by reference, may be performed before entering intothe down-mixing module 201/301, 251/351. In such an embodiment, thefactor β may end-up having a different meaning from that which has beendescribed hereinabove. For this type of implementation, at the conditionthat the temporal delay correction operates as expected, the factor βmay become close to 0.5, meaning that the configuration of the timedomain down mixing is close to a mono/side configuration. With properoperation of the temporal delay correction (TDC), the side may contain asignal including a smaller amount of important information. In thatcase, the bitrate of the secondary channel X may be minimum when thefactor β is close to 0.5. On the other hand, if the factor β is close to0 or 1, this means that the temporal delay correction (TDC) may notproperly overcome the delay miss-alignment situation and the content ofthe secondary channel X is likely to be more complex, thus needing ahigher bitrate. For both types of implementation, the factor β and byassociation the energy normalization (rescaling) factor ε, may be usedto improve the bit allocation between the primary channel Y and thesecondary channel X.

FIG. 14 is a block diagram showing concurrently operations of anout-of-phase signal detection and modules of an out-of-phase signaldetector 1450 forming part of the down-mixing operation 201/301 andchannel mixer 251/351. The operations of the out-of-phase signaldetection includes, as shown in FIG. 14, an out-of-phase signaldetection operation 1401, a switching position detection operation 1402,and channel mixer selection operation 1403, to choose between thetime-domain down mixing operation 201/301 and an out-of-phase specifictime domain down mixing operation 1404. These operations arerespectively performed by an out-of-phase signal detector 1451, aswitching position detector 1452, a channel mixer selector 1453, thepreviously described time domain down channel mixer 251/351, and anout-of-phase specific time domain down channel mixer 1454.

The out-of-phase signal detection 1401 is based on an open loopcorrelation between the primary and secondary channels in previousframes. To this end, the detector 1451 computes in the previous framesan energy difference S_(m)(t) between a side signal s(i) and a monosignal m(i) using relations (12a) and (12b):

$\begin{matrix}{{{S_{m}(t)} = {10 \cdot ( {{\log_{10}( \frac{\sqrt{\sum_{i = 0}^{N - 1}{s(i)}^{2}}}{N} )} - {\log_{10}( \frac{\sqrt{\sum_{i = 0}^{N - 1}{m(i)}^{2}}}{N} )}} )}},} & ( {12a} ) \\{{{{m(i)} = {{( \frac{{L(i)} + {R(i)}}{2} )\mspace{20mu}{and}{\;\mspace{14mu}}{s(i)}} = ( \frac{{L(i)} - {R(i)}}{2} )}},}\mspace{11mu}} & ( {12b} )\end{matrix}$

Then, the detector 1451 computes the long term side to mono energydifference S_(m) (t) using relation (12c):

$\begin{matrix}{{\overset{\_}{S_{m}}(t)} = \{ \begin{matrix}{{0.9 \cdot {\overset{\_}{S_{m}}( t_{- 1} )}},} & {{{for}\mspace{14mu}{inactive}\mspace{14mu}{content}},} \\{{{0.9 \cdot {\overset{\_}{S_{m}}( t_{- 1} )}} + {0.1 \cdot {S_{m}(t)}}},} & {otherwise}\end{matrix} } & ( {12c} )\end{matrix}$

where t indicates the current frame, t⁻¹ the previous frame, and whereinactive content may be derived from the Voice Activity Detector (VAD)hangover flag or from a VAD hangover counter.

In addition to the long term side to mono energy difference S_(m) (t),the last pitch open loop maximum correlation C_(F|R) of each channel Yand X, as defined in clause 5.1.10 of Reference [1], is also taken intoaccount to decide when the current model is considered as sub-optimal.C_(P(t) ⁻¹ ₎ represents the pitch open loop maximum correlation of theprimary channel Y in a previous frame and C_(S(t) ⁻¹ ₎, the open pitchloop maximum correlation of the secondary channel X in the previousframe. A sub-optimality flag F_(sub) is calculated by the switchingposition detector 1452 according to the following criteria:

If the long term side to mono energy difference S_(m) (t) is above acertain threshold, for example when S_(m) (t)>2.0, if both the pitchopen loop maximum correlations C_(P(t) ⁻¹ ₎ and C_(S(t) ⁻¹ ₎ are between0.85 and 0.92, meaning the signals have a good correlation, but are notas correlated as a voiced signal would be, the sub-optimality flagF_(sub) is set to 1, indicating an out-of-phase condition between theleft L and right R channels.

Otherwise, the sub-optimality flag F_(sub) is set to 0, indicating noout-of-phase condition between the left L and right R channels.

To add some stability in the sub-optimality flag decision, the switchingposition detector 1452 implements a criterion regarding the pitchcontour of each channel Y and X. The switching position detector 1452determines that the channel mixer 1454 will be used to code thesub-optimal signals when, in the example embodiment, at least three (3)consecutive instances of the sub-optimality flag F_(sub) are set to 1and the pitch stability of the last frame of one of the primary channel,p_(pc(t−1)), or of the secondary channel, p_(sc(t−1)), is greater than64. The pitch stability consists in the sum of the absolute differencesof the three open loop pitches p_(0|1|2) as defined in 5.1.10 ofReference [1], computed by the switching position detector 1452 usingrelation (12d):p _(pc) =|p ₁ −p ₀ |+|p ₂ −p ₁| and p _(sc) =|p ₁ −p ₀ |+|p ₂ −p₁|  (12d)

The switching position detector 1452 provides the decision to thechannel mixer selector 1453 that, in turn, selects the channel mixer251/351 or the channel mixer 1454 accordingly. The channel mixerselector 1453 implements a hysteresis such that, when the channel mixer1454 is selected, this decision holds until the following conditions aremet: a number of consecutive frames, for example 20 frames, areconsidered as being optimal, the pitch stability of the last frame ofone of the primary p_(pc(t−1)) or the secondary channel p_(sc(t−1)) isgreater than a predetermined number, for example 64, and the long termside to mono energy difference S_(m) (t) is below or equal to 0.

2) Dynamic Encoding Between Primary and Secondary Channels

FIG. 8 is a block diagram illustrating concurrently the stereo soundencoding method and system, with a possible implementation ofoptimization of the encoding of both the primary Y and secondary Xchannels of the stereo sound signal, such as speech or audio.

Referring to FIG. 8, the stereo sound encoding method comprises a lowcomplexity pre-processing operation 801 implemented by a low complexitypre-processor 851, a signal classification operation 802 implemented bya signal classifier 852, a decision operation 803 implemented by adecision module 853, a four (4) subframes model generic only encodingoperation 804 implemented by a four (4) subframes model generic onlyencoding module 854, a two (2) subframes model encoding operation 805implemented by a two (2) subframes model encoding module 855, and an LPfilter coherence analysis operation 806 implemented by an LP filtercoherence analyzer 856.

After time-domain down mixing 301 has been performed by the channelmixer 351, in the case of the embedded model, the primary channel Y isencoded (primary channel encoding operation 302) (a) using as theprimary channel encoder 352 a legacy encoder such as the legacy EVSencoder or any other suitable legacy sound encoder (It should be kept inmind that, as mentioned in the foregoing description, any suitable typeof encoder can be used as the primary channel encoder 352). In the caseof an integrated structure, a dedicated speech codec is used as primarychannel encoder 252. The dedicated speech encoder 252 may be a variablebit-rate (VBR) based encoder, for example a modified version of thelegacy EVS encoder, which has been modified to have a greater bitratescalability that permits the handling of a variable bitrate on a perframe level (Again it should be kept in mind that, as mentioned in theforegoing description, any suitable type of encoder can be used as theprimary channel encoder 252). This allows that the minimum amount ofbits used for encoding the secondary channel X to vary in each frame andbe adapted to the characteristics of the sound signal to be encoded. Atthe end, the signature of the secondary channel X will be as homogeneousas possible.

Encoding of the secondary channel X, i.e. the lower energy/correlationto mono input, is optimized to use a minimal bit-rate, in particular butnot exclusively for speech like content. For that purpose, the secondarychannel encoding can take advantage of parameters that are alreadyencoded in the primary channel Y, such as the LP filter coefficients(LPC) and/or pitch lag 807. Specifically, it will be decided, asdescribed hereinafter, if the parameters calculated during the primarychannel encoding are sufficiently close to corresponding parameterscalculated during the secondary channel encoding to be re-used duringthe secondary channel encoding.

First, the low complexity pre-processing operation 801 is applied to thesecondary channel X using the low complexity pre-processor 851, whereina LP filter, a voice activity detection (VAD) and an open loop pitch arecomputed in response to the secondary channel X. The latter calculationsmay be implemented, for example, by those performed in the EVS legacyencoder and described respectively in clauses 5.1.9, 5.1.12 and 5.1.10of Reference [1] of which, as indicated hereinabove, the full contentsis herein incorporated by reference. Since, as mentioned in theforegoing description, any suitable type of encoder may be used as theprimary channel encoder 252/352, the above calculations may beimplemented by those performed in such a primary channel encoder.

Then, the characteristics of the secondary channel X signal are analyzedby the signal classifier 852 to classify the secondary channel X asunvoiced, generic or inactive using techniques similar to those of theEVS signal classification function, clause 5.1.13 of the same Reference[1]. These operations are known to those of ordinary skill in the artand can been extracted from Standard 3GPP TS 26.445, v. 12.0.0 forsimplicity, but alternative implementations can be used as well.

a. Reusing the Primary Channel LP Filter Coefficients

An important part of bit-rate consumption resides in the quantization ofthe LP filter coefficients (LPC). At low bit-rate, full quantization ofthe LP filter coefficients can take up to nearly 25% of the bit budget.Given that the secondary channel X is often close in frequency contentto the primary channel Y, but with lowest energy level, it is worthverifying if it would be possible to reuse the LP filter coefficients ofthe primary channel Y. To do so, as shown in FIG. 8, an LP filtercoherence analysis operation 806 implemented by an LP filter coherenceanalyzer 856 has been developed, in which few parameters are computedand compared to validate the possibility to re-use or not the LP filtercoefficients (LPC) 807 of the primary channel Y.

FIG. 9 is a block diagram illustrating the LP filter coherence analysisoperation 806 and the corresponding LP filter coherence analyzer 856 ofthe stereo sound encoding method and system of FIG. 8.

The LP filter coherence analysis operation 806 and corresponding LPfilter coherence analyzer 856 of the stereo sound encoding method andsystem of FIG. 8 comprise, as illustrated in FIG. 9, a primary channelLP (Linear Prediction) filter analysis sub-operation 903 implemented byan LP filter analyzer 953, a weighing sub-operation 904 implemented by aweighting filter 954, a secondary channel LP filter analysissub-operation 912 implemented by an LP filter analyzer 962, a weighingsub-operation 901 implemented by a weighting filter 951, an Euclideandistance analysis sub-operation 902 implemented by an Euclidean distanceanalyzer 952, a residual filtering sub-operation 913 implemented by aresidual filter 963, a residual energy calculation sub-operation 914implemented by a calculator 964 of energy of residual, a subtractionsub-operation 915 implemented by a subtractor 965, a sound (such asspeech and/or audio) energy calculation sub-operation 910 implemented bya calculator 960 of energy, a secondary channel residual filteringoperation 906 implemented by a secondary channel residual filter 956, aresidual energy calculation sub-operation 907 implemented by acalculator of energy of residual 957, a subtraction sub-operation 908implemented by a subtractor 958, a gain ratio calculation sub-operation911 implemented by a calculator of gain ratio, a comparisonsub-operation 916 implemented by a comparator 966, a comparisonsub-operation 917 implemented by a comparator 967, a secondary channelLP filter use decision sub-operation 918 implemented by a decisionmodule 968, and a primary channel LP filter re-use decisionsub-operation 919 implemented by a decision module 969.

Referring to FIG. 9, the LP filter analyzer 953 performs an LP filteranalysis on the primary channel Y while the LP filter analyzer 962performs an LP filter analysis on the secondary channel X. The LP filteranalysis performed on each of the primary Y and secondary X channels issimilar to the analysis described in clause 5.1.9 of Reference [1].

Then, the LP filter coefficients A_(y) from the LP filter analyzer 953are supplied to the residual filter 956 for a first residual filtering,r_(Y), of the secondary channel X. In the same manner, the optimal LPfilter coefficients A_(x) from the LP filter analyzer 962 are suppliedto the residual filter 963 for a second residual filtering, r_(X), ofthe secondary channel X. The residual filtering with either filtercoefficients, A_(Y) or A_(X), is performed as using relation (11):r _(Y|X)(n)=s _(X)(n)+Σ_(i=0) ¹⁶(A _(Y|X)(i)·s _(X)(n−i)), n=0, . . .N−1  (13)

where, in this example, s_(x) represents the secondary channel, the LPfilter order is 16, and N is the number of samples in the frame (framesize) which is usually 256 corresponding a 20 ms frame duration at asampling rate of 12.8 kHz.

The calculator 910 computes the energy E_(x) of the sound signal in thesecondary channel X using relation (14):E _(x)=10·log₁₀(Σ_(i=0) ^(N−1) s _(x)(i)²),  (14)

and the calculator 957 computes the energy E_(ry) of the residual fromthe residual filter 956 using relation (15):E _(ry)=10·log₁₀(Σ_(i=0) ^(N−1) r _(y)(i)²).  (15)

The subtractor 958 subtracts the residual energy from calculator 957from the sound energy from calculator 960 to produce a prediction gainG_(y).

In the same manner, the calculator 964 computes the energy E_(rx) of theresidual from the residual filter 963 using relation (16):E _(rx)=10·log₁₀(Σ_(i=0) ^(N−1) r _(x)(i)²),  (16)

and the subtractor 965 subtracts this residual energy from the soundenergy from calculator 960 to produce a prediction gain G_(X).

The calculator 961 computes the gain ratio G_(Y)/G_(X). The comparator966 compares the gain ratio G_(Y)/G_(X) to a threshold τ, which is 0.92in the example embodiment. If the ratio G_(Y)/G_(X) is smaller than thethreshold τ, the result of the comparison is transmitted to decisionmodule 968 which forces use of the secondary channel LP filtercoefficients for encoding the secondary channel X.

The Euclidean distance analyzer 952 performs an LP filter similaritymeasure, such as the Euclidean distance between the line spectral pairslsp_(Y) computed by the LP filter analyzer 953 in response to theprimary channel Y and the line spectral pairs lsp_(X) computed by the LPfilter analyzer 962 in response to the secondary channel X. As known tothose of ordinary skill in the art, the line spectral pairs lsp_(Y) andlsp_(X) represent the LP filter coefficients in a quantization domain.The analyzer 952 uses relation (17) to determine the Euclidean distancedist:

$\begin{matrix}{{dist} = {\sum\limits_{i = 0}^{M - 1}( {{{lsp}_{Y}(i)} - {{lsp}_{X}(i)}} )^{2}}} & (17)\end{matrix}$

where M represents the filter order, and lsp_(Y) and lsp_(X) representrespectively the line spectral pairs computed for the primary Y and thesecondary X channels.

Before computing the Euclidean distance in analyzer 952, it is possibleto weight both sets of line spectral pairs lsp_(Y) and lsp_(X) throughrespective weighting factors such that more or less emphasis is put oncertain portions of the spectrum. Other LP filter representations can bealso used to compute the LP filter similarity measure.

Once the Euclidian distance dist is known, it is compared to a thresholdσ in comparator 967. In the example embodiment, the threshold σ has avalue of 0.08. When the comparator 966 determines that the ratioG_(Y)/G_(X) is equal to or larger than the threshold τ and thecomparator 967 determines that the Euclidian distance dist is equal toor larger than the threshold σ, the result of the comparisons istransmitted to decision module 968 which forces use of the secondarychannel LP filter coefficients for encoding the secondary channel X.When the comparator 966 determines that the ratio G_(Y)/G_(X) is equalto or larger than the threshold τ and the comparator 967 determines thatthe Euclidian distance dist is smaller than the threshold σ, the resultof these comparisons is transmitted to decision module 969 which forcesre-use of the primary channel LP filter coefficients for encoding thesecondary channel X. In the latter case, the primary channel LP filtercoefficients are re-used as part of the secondary channel encoding.

Some additional tests can be conducted to limit re-usage of the primarychannel LP filter coefficients for encoding the secondary channel X inparticular cases, for example in the case of unvoiced coding mode, wherethe signal is sufficiently easy to encode that there is still bit-rateavailable to encode the LP filter coefficients as well. It is alsopossible to force re-use of the primary channel LP filter coefficientswhen a very low residual gain is already obtained with the secondarychannel LP filter coefficients or when the secondary channel X has avery low energy level. Finally, the variables τ, σ, the residual gainlevel or the very low energy level at which the reuse of the LP filtercoefficients can be forced can all be adapted as a function of the bitbudget available and/or as a function of the content type. For example,if the content of the secondary channel is considered as inactive, theneven if the energy is high, it may be decided to reuse the primarychannel LP filter coefficients.

b. Low Bit-Rate Encoding of Secondary Channel

Since the primary Y and secondary X channels may be a mix of both theright R and left L input channels, this implies that, even if the energycontent of the secondary channel X is low compared to the energy contentof the primary channel Y, a coding artefact may be perceived once theup-mix of the channels is performed. To limit such possible artefact,the coding signature of the secondary channel X is kept as constant aspossible to limit any unintended energy variation. As shown in FIG. 7,the content of the secondary channel X has similar characteristics tothe content of the primary channel Y and for that reason a very lowbit-rate speech like coding model has been developed.

Referring back to FIG. 8, the LP filter coherence analyzer 856 sends tothe decision module 853 the decision to re-use the primary channel LPfilter coefficients from decision module 969 or the decision to use thesecondary channel LP filter coefficients from decision module 968.Decision module 803 then decides not to quantize the secondary channelLP filter coefficients when the primary channel LP filter coefficientsare re-used and to quantize the secondary channel LP filter coefficientswhen the decision is to use the secondary channel LP filtercoefficients. In the latter case, the quantized secondary channel LPfilter coefficients are sent to the multiplexer 254/354 for inclusion inthe multiplexed bitstream 207/307.

In the four (4) subframes model generic only encoding operation 804 andthe corresponding four (4) subframes model generic only encoding module854, to keep the bit-rate as low as possible, an ACELP search asdescribed in clause 5.2.3.1 of Reference [1] is used only when the LPfilter coefficients from the primary channel Y can be re-used, when thesecondary channel X is classified as generic by signal classifier 852,and when the energy of the input right R and left L channels is close tothe center, meaning that the energies of both the right R and left Lchannels are close to each other. The coding parameters found during theACELP search in the four (4) subframes model generic only encodingmodule 854 are then used to construct the secondary channel bitstream206/306 and sent to the multiplexer 254/354 for inclusion in themultiplexed bitstream 207/307.

Otherwise, in the two (2) subframes model encoding operation 805 and thecorresponding two (2) subframes model encoding module 855, a half-bandmodel is used to encode the secondary channel X with generic contentwhen the LP filter coefficients from the primary channel Y cannot bere-used. For the inactive and unvoiced content, only the spectrum shapeis coded.

In encoding module 855, inactive content encoding comprises (a)frequency domain spectral band gain coding plus noise filling and (b)coding of the secondary channel LP filter coefficients when needed asdescribed respectively in (a) clauses 5.2.3.5.7 and 5.2.3.5.11 and (b)clause 5.2.2.1 of Reference [1]. Inactive content can be encoded at abit-rate as low as 1.5 kb/s.

In encoding module 855, the secondary channel X unvoiced encoding issimilar to the secondary channel X inactive encoding, with the exceptionthat the unvoiced encoding uses an additional number of bits for thequantization of the secondary channel LP filter coefficients which areencoded for unvoiced secondary channel.

The half-band generic coding model is constructed similarly to ACELP asdescribed in clause 5.2.3.1 of Reference [1], but it is used with onlytwo (2) sub-frames by frame. Thus, to do so, the residual as describedin clause 5.2.3.1.1 of Reference [1], the memory of the adaptivecodebook as described in clause 5.2.3.1.4 of Reference [1] and the inputsecondary channel are first down-sampled by a factor 2. The LP filtercoefficients are also modified to represent the down-sampled domaininstead of the 12.8 kHz sampling frequency using a technique asdescribed in clause 5.4.4.2 of Reference [1].

After the ACELP search, a bandwidth extension is performed in thefrequency domain of the excitation. The bandwidth extension firstreplicates the lower spectral band energies into the higher band. Toreplicate the spectral band energies, the energy of the first nine (9)spectral bands, G_(bd)(i), are found as described in clause 5.2.3.5.7 ofReference [1] and the last bands are filled as shown in relation (18):G _(bd)(i)=G _(bd)(16−i−1), for i=8, . . . ,15.  (18)

Then, the high frequency content of the excitation vector represented inthe frequency domain f_(d)(k) as described in clause 5.2.3.5.9 ofReference [1] is populated using the lower band frequency content usingrelation (19):f _(d)(k)=f _(d)(k−P _(b)), for k=128, . . . ,255,  (19)

where the pitch offset, P_(b), is based on a multiple of the pitchinformation as described in clause 5.2.3.1.4.1 of Reference [1] and isconverted into an offset of frequency bins as shown in relation (20):

$\begin{matrix}{{P_{b} = \begin{matrix}{\frac{8 \cdot ( \frac{F_{s}}{\overset{\_}{T}} )}{F_{r}},} & {\overset{\_}{T} > 64} \\\frac{4 \cdot ( \frac{F_{s}}{\overset{\_}{T}} )}{F_{r}} & {\overset{\_}{T} \leq 64}\end{matrix}},} & (20)\end{matrix}$

where T represents an average of the decoded pitch information persubframe, F_(s) is the internal sampling frequency, 12.8 kHz in thisexample embodiment, and F_(r) is the frequency resolution.

The coding parameters found during the low-rate inactive encoding, thelow rate unvoiced encoding or the half-band generic encoding performedin the two (2) subframes model encoding module 855 are then used toconstruct the secondary channel bitstream 206/306 sent to themultiplexer 254/354 for inclusion in the multiplexed bitstream 207/307.

c. Alternative Implementation of the Secondary Channel Low Bit-RateEncoding

Encoding of the secondary channel X may be achieved differently, withthe same goal of using a minimal number of bits while achieving the bestpossible quality and while keeping a constant signature. Encoding of thesecondary channel X may be driven in part by the available bit budget,independently from the potential re-use of the LP filter coefficientsand the pitch information. Also, the two (2) subframes model encoding(operation 805) may either be half band or full band. In thisalternative implementation of the secondary channel low bit-rateencoding, the LP filter coefficients and/or the pitch information of theprimary channel can be re-used and the two (2) subframes model encodingcan be chosen based on the bit budget available for encoding thesecondary channel X. Also, the 2 subframes model encoding presentedbelow has been created by doubling the subframe length instead ofdown-sampling/up-sampling its input/output parameters.

FIG. 15 is a block diagram illustrating concurrently an alternativestereo sound encoding method and an alternative stereo sound encodingsystem. The stereo sound encoding method and system of FIG. 15 includeseveral of the operations and modules of the method and system of FIG.8, identified using the same reference numerals and whose description isnot repeated herein for brevity. In addition, the stereo sound encodingmethod of FIG. 15 comprises a pre-processing operation 1501 applied tothe primary channel Y before its encoding at operation 202/302, a pitchcoherence analysis operation 1502, an unvoiced/inactive decisionoperation 1504, an unvoiced/inactive coding decision operation 1505, anda 2/4 subframes model decision operation 1506.

The sub-operations 1501, 1502, 1503, 1504, 1505 and 1506 arerespectively performed by a pre-processor 1551 similar to low complexitypre-processor 851, a pitch coherence analyzer 1552, a bit allocationestimator 1553, a unvoiced/inactive decision module 1554, anunvoiced/inactive encoding decision module 1555 and a 2/4 subframesmodel decision module 1556.

To perform the pitch coherence analysis operation 1502, the pitchcoherence analyzer 1552 is supplied by the pre-processors 851 and 1551with open loop pitches of both the primary Y and secondary X channels,respectively OLpitch_(pri) and OLpitch_(sec). The pitch coherenceanalyzer 1552 of FIG. 15 is shown in greater details in FIG. 16, whichis a block diagram illustrating concurrently sub-operations of the pitchcoherence analysis operation 1502 and modules of the pitch coherenceanalyzer 1552.

The pitch coherence analysis operation 1502 performs an evaluation ofthe similarity of the open loop pitches between the primary channel Yand the secondary channel X to decide in what circumstances the primaryopen loop pitch can be re-used in coding the secondary channel X. Tothis end, the pitch coherence analysis operation 1502 comprises aprimary channel open loop pitches summation sub-operation 1601 performedby a primary channel open loop pitches adder 1651, and a secondarychannel open loop pitches summation sub-operation 1602 performed by asecondary channel open loop pitches adder 1652. The summation from adder1652 is subtracted (sub-operation 1603) from the summation from adder1651 using a subtractor 1653. The result of the subtraction fromsub-operation 1603 provides a stereo pitch coherence. As annon-limitative example, the summations in sub-operations 1601 and 1602are based on three (3) previous, consecutive open loop pitches availablefor each channel Y and X. The open loop pitches can be computed, forexample, as defined in clause 5.1.10 of Reference [1]. The stereo pitchcoherence S_(pc) is computed in sub-operations 1601, 1602 and 1603 usingrelation (21):S _(pc)=|Σ_(i=0) ² p _(p(i))−Σ_(i=0) ² ps(i)|  (21)

where p_(p|s(i)) represent the open loop pitches of the primary Y andsecondary X channels and i represents the position of the open looppitches.

When the stereo pitch coherence is below a predetermined threshold Δ,re-use of the pitch information from the primary channel Y may beallowed depending of an available bit budget to encode the secondarychannel X. Also, depending of the available bit budget, it is possibleto limit re-use of the pitch information for signals that have a voicedcharacteristic for both the primary Y and secondary X channels.

To this end, the pitch coherence analysis operation 1502 comprises adecision sub-operation 1604 performed by a decision module 1654 whichconsider the available bit budget and the characteristics of the soundsignal (indicated for example by the primary and secondary channelcoding modes). When the decision module 1654 detects that the availablebit budget is sufficient or the sound signals for both the primary Y andsecondary X channels have no voiced characteristic, the decision is toencode the pitch information related to the secondary channel X (1605).

When the decision module 1654 detects that the available bit budget islow for the purpose of encoding the pitch information of the secondarychannel X or the sound signals for both the primary Y and secondary Xchannels have a voiced characteristic, the decision module compares thestereo pitch coherence S_(pc) to the threshold Δ. When the bit budget islow, the threshold Δ is set to a larger value compared to the case wherethe bit budget more important (sufficient to encode the pitchinformation of the secondary channel X). When the absolute value of thestereo pitch coherence S_(pc) is smaller than or equal to the thresholdΔ, the module 1654 decides to re-use the pitch information from theprimary channel Y to encode the secondary channel X (1607). When thevalue of the stereo pitch coherence S_(pc) is higher than the thresholdΔ, the module 1654 decides to encode the pitch information of thesecondary channel X (1605).

Ensuring the channels have voiced characteristics increases thelikelihood of a smooth pitch evolution, thus reducing the risk of addingartefacts by re-using the pitch of the primary channel. As anon-limitative example, when the stereo bit budget is below 14 kb/s andthe stereo pitch coherence S_(pc) is below or equal to a 6 (Δ=6), theprimary pitch information can be re-used in encoding the secondarychannel X. According to another non-limitative example, if the stereobit budget is above 14 kb/s and below 26 kb/s, then both the primary Yand secondary X channels are considered as voiced and the stereo pitchcoherence S_(pc) is compared to a lower threshold Δ=3, which leads to asmaller re-use rate of the pitch information of the primary channel Y ata bit-rate of 22 kb/s.

Referring back to FIG. 15, the bit allocation estimator 1553 is suppliedwith the factor β from the channel mixer 251/351, with the decision tore-use the primary channel LP filter coefficients or to use and encodethe secondary channel LP filter coefficients from the LP filtercoherence analyzer 856, and with the pitch information determined by thepitch coherence analyzer 1552. Depending on primary and secondarychannel encoding requirements, the bit allocation estimator 1553provides a bit budget for encoding the primary channel Y to the primarychannel encoder 252/352 and a bit budget for encoding the secondarychannel X to the decision module 1556. In one possible implementation,for all content that is not INACTIVE, a fraction of the total bit-rateis allocated to the secondary channel. Then, the secondary channelbit-rate will be increased by an amount which is related to an energynormalization (rescaling) factor ε described previously as:B _(x) =B _(M)+(0.25·ε−0.125)·(B _(t)−2·B _(m))  (21a)where B_(x) represents the bit-rate allocated to the secondary channelX, B_(t) represents the total stereo bit-rate available, B_(M)represents the minimum bit-rate allocated to the secondary channel andis usually around 20% of the total stereo bitrate. Finally, ε representsthe above described energy normalization factor. Hence, the bit-rateallocated to the primary channel corresponds to the difference betweenthe total stereo bit-rate and the secondary channel stereo bit-rate. Inan alternative implementation the secondary channel bit-rate allocationcan be described as:

$\begin{matrix}{B_{x} = \begin{matrix}{{B_{M} + {( {( {15 - ɛ_{idx}} ) \cdot ( {B_{t} - {2 \cdot B_{M}}} )} ) \cdot 0.05}},} & {{{if}\mspace{14mu} ɛ_{idx}} < 15} \\{{B_{M} + {( {( {ɛ_{idx} - 15} ) \cdot ( {B_{t} - {2 \cdot B_{M}}} )} ) \cdot 0.05}},} & {{{if}\mspace{14mu} ɛ_{idx}} \geq 15}\end{matrix}} & ( {21b} )\end{matrix}$

where again B_(x) represents the bit-rate allocated to the secondarychannel X, B_(t) represents the total stereo bit-rate available andB_(M) represents the minimum bit-rate allocated to the secondarychannel. Finally, ε_(idx) represents a transmitted index of the energynormalization factor. Hence, the bit-rate allocated to the primarychannel corresponds to the difference between the total stereo bit-rateand the secondary channel bit-rate. In all cases, for INACTIVE content,the secondary channel bit-rate is set to the minimum bit-rate needed toencode the spectral shape of the secondary channel giving a bitrateusually close to 2 kb/s.

Meanwhile, the signal classifier 852 provides a signal classification ofthe secondary channel X to the decision module 1554. If the decisionmodule 1554 determines that the sound signal is inactive or unvoiced,the unvoiced/inactive encoding module 1555 provides the spectral shapeof the secondary channel X to the multiplexer 254/354. Alternatively,the decision module 1554 informs the decision module 1556 when the soundsignal is neither inactive nor unvoiced. For such sound signals, usingthe bit budget for encoding the secondary channel X, the decision module1556 determines whether there is a sufficient number of available bitsfor encoding the secondary channel X using the four (4) subframes modelgeneric only encoding module 854; otherwise the decision module 1556selects to encode the secondary channel X using the two (2) subframesmodel encoding module 855. To choose the four subframes model genericonly encoding module, the bit budget available for the secondary channelmust be high enough to allocate at least 40 bits to the algebraiccodebooks, once everything else is quantized or reused, including the LPcoefficient and the pitch information and gains.

As will be understood from the above description, in the four (4)subframes model generic only encoding operation 804 and thecorresponding four (4) subframes model generic only encoding module 854,to keep the bit-rate as low as possible, an ACELP search as described inclause 5.2.3.1 of Reference [1] is used. In the four (4) subframes modelgeneric only encoding, the pitch information can be re-used from theprimary channel or not. The coding parameters found during the ACELPsearch in the four (4) subframes model generic only encoding module 854are then used to construct the secondary channel bitstream 206/306 andsent to the multiplexer 254/354 for inclusion in the multiplexedbitstream 207/307.

In the alternative two (2) subframes model encoding operation 805 andthe corresponding alternative two (2) subframes model encoding module855, the generic coding model is constructed similarly to ACELP asdescribed in clause 5.2.3.1 of Reference [1], but it is used with onlytwo (2) sub-frames by frame. Thus, to do so, the length of the subframesis increased from 64 samples to 128 samples, still keeping the internalsampling rate at 12.8 kHz. If the pitch coherence analyzer 1552 hasdetermined to re-use the pitch information from the primary channel Yfor encoding the secondary channel X, then the average of the pitches ofthe first two subframes of the primary channel Y is computed and used asthe pitch estimation for the first half frame of the secondary channelX. Similarly, the average of the pitches of the last two subframes ofthe primary channel Y is computed and used for the second half frame ofthe secondary channel X. When re-used from the primary channel Y, the LPfilter coefficients are interpolated and interpolation of the LP filtercoefficients as described in clause 5.2.2.1 of Reference [1] is modifiedto adapt to a two (2) subframes scheme by replacing the first and thirdinterpolation factors with the second and fourth interpolation factors.

In the embodiment of FIG. 15, the process to decide between the four (4)subframes and the two (2) subframes encoding scheme is driven by the bitbudget available for encoding the secondary channel X. As mentionedpreviously, the bit budget of the secondary channel X is derived fromdifferent elements such as the total bit budget available, the factor βor the energy normalization factor ε, the presence or not of a temporaldelay correction (TDC) module, the possibility or not to re-use the LPfilter coefficients and/or the pitch information from the primarychannel Y.

The absolute minimum bit rate used by the two (2) subframes encodingmodel of the secondary channel X when both the LP filter coefficientsand the pitch information are re-used from the primary channel Y isaround 2 kb/s for a generic signal while it is around 3.6 kb/s for thefour (4) subframes encoding scheme. For an ACELP-like coder, using a two(2) or four (4) subframes encoding model, a large part of the quality iscoming from the number of bit that can be allocated to the algebraiccodebook (ACB) search as defined in clause 5.2.3.1.5 of reference [1].

Then, to maximize the quality, the idea is to compare the bit budgetavailable for both the four (4) subframes algebraic codebook (ACB)search and the two (2) subframes algebraic codebook (ACB) search afterthat all what will be coded is taken into account. For example, if, fora specific frame, there is 4 kb/s (80 bits per 20 ms frame) available tocode the secondary channel X and the LP filter coefficient can bere-used while the pitch information needs to be transmitted. Then isremoved from the 80 bits, the minimum amount of bits for encoding thesecondary channel signaling, the secondary channel pitch information,the gains, and the algebraic codebook for both the two (2) subframes andthe four (4) subframes, to get the bit budget available to encode thealgebraic codebook. For example, the four (4) subframes encoding modelis chosen if at least 40 bits are available to encode the four (4)subframes algebraic codebook otherwise, the two (2) subframe scheme isused.

3) Approximating the Mono Signal from a Partial Bitstream

As described in the foregoing description, the time domain down-mixingis mono friendly, meaning that in case of an embedded structure, wherethe primary channel Y is encoded with a legacy codec (It should be keptin mind that, as mentioned in the foregoing description, any suitabletype of encoder can be used as the primary channel encoder 252/352) andthe stereo bits are appended to the primary channel bitstream, thestereo bits could be stripped-off and a legacy decoder could create asynthesis that is subjectively close to an hypothetical mono synthesis.To do so, simple energy normalization is needed on the encoder side,before encoding the primary channel Y. By rescaling the energy of theprimary channel Y to a value sufficiently close to an energy of amonophonic signal version of the sound, decoding of the primary channelY with a legacy decoder can be similar to decoding by the legacy decoderof the monophonic signal version of the sound. The function of theenergy normalization is directly linked to the linearized long-termcorrelation difference G_(LR)′(t) computed using relation (7) and iscomputed using relation (22):ε=−0.485·G _(LR)′(t)²+0.9765·G _(LR)′(t)+0.5.  (22)

The level of normalization is shown in FIG. 5. In practice, instead ofusing relation (22), a look-up table is used relating the normalizationvalues E to each possible value of the factor β (31 values in thisexample embodiment). Even if this extra step is not required whenencoding a stereo sound signal, for example speech and/or audio, withthe integrated model, this can be helpful when decoding only the monosignal without decoding the stereo bits.

4) Stereo Decoding and Up-Mixing

FIG. 10 is a block diagram illustrating concurrently a stereo sounddecoding method and stereo sound decoding system. FIG. 11 is a blockdiagram illustrating additional features of the stereo sound decodingmethod and stereo sound decoding system of FIG. 10.

The stereo sound decoding method of FIGS. 10 and 11 comprises ademultiplexing operation 1007 implemented by a demultiplexer 1057, aprimary channel decoding operation 1004 implemented by a primary channeldecoder 1054, a secondary channel decoding operation 1005 implemented bya secondary channel decoder 1055, and a time domain up-mixing operation1006 implemented by a time domain channel up-mixer 1056. The secondarychannel decoding operation 1005 comprises, as shown in FIG. 11, adecision operation 1101 implemented by a decision module 1151, a four(4) subframes generic decoding operation 1102 implemented by a four (4)subframes generic decoder 1152, and a two (2) subframesgeneric/unvoiced/inactive decoding operation 1103 implemented by a two(2) subframes generic/unvoiced/inactive decoder 1153.

At the stereo sound decoding system, a bitstream 1001 is received froman encoder. The demultiplexer 1057 receives the bitstream 1001 andextracts therefrom encoding parameters of the primary channel Y(bitstream 1002), encoding parameters of the secondary channel X(bitstream 1003), and the factor β supplied to the primary channeldecoder 1054, the secondary channel decoder 1055 and the channelup-mixer 1056. As mentioned earlier, the factor β is used as anindicator for both the primary channel encoder 252/352 and the secondarychannel encoder 253/353 to determine the bit-rate allocation, thus theprimary channel decoder 1054 and the secondary channel decoder 1055 areboth re-using the factor β to decode the bitstream properly.

The primary channel encoding parameters correspond to the ACELP codingmodel at the received bit-rate and could be related to a legacy ormodified EVS coder (It should be kept in mind here that, as mentioned inthe foregoing description, any suitable type of encoder can be used asthe primary channel encoder 252). The primary channel decoder 1054 issupplied with the bitstream 1002 to decode the primary channel encodingparameters (codec mode₁, β, LPC₁, Pitch₁, fixed codebook indices₁, andgains₁ as shown in FIG. 11) using a method similar to Reference [1] toproduce a decoded primary channel Y′.

The secondary channel encoding parameters used by the secondary channeldecoder 1055 correspond to the model used to encode the second channel Xand may comprise:

(a) The generic coding model with re-use of the LP filter coefficients(LPC₁) and/or other encoding parameters (such as, for example, the pitchlag Pitch₁) from the primary channel Y. The four (4) subframes genericdecoder 1152 (FIG. 11) of the secondary channel decoder 1055 is suppliedwith the LP filter coefficients (LPC₁) and/or other encoding parameters(such as, for example, the pitch lag Pitch₁) from the primary channel Yfrom decoder 1054 and/or with the bitstream 1003 (β, Pitch₂, fixedcodebook indices₂, and gains₂ as shown in FIG. 11) and uses a methodinverse to that of the encoding module 854 (FIG. 8) to produce thedecoded secondary channel X′.

(b) Other coding models may or may not re-use the LP filter coefficients(LPC₁) and/or other encoding parameters (such as, for example, the pitchlag Pitch₁) from the primary channel Y, including the half-band genericcoding model, the low rate unvoiced coding model, and the low rateinactive coding model. As an example, the inactive coding model mayre-use the primary channel LP filter coefficients LPC₁. The two (2)subframes generic/unvoiced/inactive decoder 1153 (FIG. 11) of thesecondary channel decoder 1055 is supplied with the LP filtercoefficients (LPC₁) and/or other encoding parameters (such as, forexample, the pitch lag Pitch₁) from the primary channel Y and/or withthe secondary channel encoding parameters from the bitstream 1003 (codecmode₂, β, LPC₂, Pitch₂, fixed codebook indices₂, and gains₂ as shown inFIG. 11) and uses methods inverse to those of the encoding module 855(FIG. 8) to produce the decoded secondary channel X′.

The received encoding parameters corresponding to the secondary channelX (bitstream 1003) contain information (codec mode₂) related to thecoding model being used. The decision module 1151 uses this information(codec mode₂) to determine and indicate to the four (4) subframesgeneric decoder 1152 and the two (2) subframes generic/unvoiced/inactivedecoder 1153 which coding model is to be used.

In case of an embedded structure, the factor β is used to retrieve theenergy scaling index that is stored in a look-up table (not shown) onthe decoder side and used to rescale the primary channel Y′ beforeperforming the time domain up-mixing operation 1006. Finally the factorβ is supplied to the channel up-mixer 1056 and used for up-mixing thedecoded primary Y′ and secondary X′ channels. The time domain up-mixingoperation 1006 is performed as the inverse of the down-mixing relations(9) and (10) to obtain the decoded right R′ and left L′ channels, usingrelations (23) and (24):

$\begin{matrix}{{{L^{\prime}(n)} = \frac{{{\beta(t)} \cdot {Y^{\prime}(n)}} - {{\beta(t)} \cdot {X^{\prime}(n)}} + {X^{\prime}(n)}}{{2 \cdot {\beta(t)}^{2}} - {2 \cdot {\beta(t)}} + 1}},} & (23)\end{matrix}$

$\begin{matrix}{{{R^{\prime}(n)} = \frac{{{- {\beta(t)}} \cdot ( {{Y^{\prime}(n)} + {X^{\prime}(n)}} )} + {Y^{\prime}(n)}}{{2 \cdot {\beta(t)}^{2}} - {2 \cdot {\beta(t)}} + 1}},} & (24)\end{matrix}$

where n=0, . . . , N−1 is the index of the sample in the frame and t isthe frame index.

5) Integration of Time Domain and Frequency Domain Encoding

For applications of the present technique where a frequency domaincoding mode is used, performing the time down-mixing in the frequencydomain to save some complexity or to simplify the data flow is alsocontemplated. In such cases, the same mixing factor is applied to allspectral coefficients in order to maintain the advantages of the timedomain down mixing. It may be observed that this is a departure fromapplying spectral coefficients per frequency band, as in the case ofmost of the frequency domain down-mixing applications. The down mixer456 may be adapted to compute relations (25.1) and (25.2):F _(Y)(k)=F _(R)(k)·(1−β(t))+F _(L)(k)·β(t)  (25.1)F _(X)(k)=F _(L)(k)·(1−β(t))−F _(R)(k)·β(t),  (25.2)

where F_(R)(k) represents a frequency coefficient k of the right channelR and, similarly, F_(L)(k) represents a frequency coefficient k of theleft channel L. The primary Y and secondary X channels are then computedby applying an inverse frequency transform to obtain the timerepresentation of the down mixed signals.

FIGS. 17 and 18 show possible implementations of time domain stereoencoding method and system using frequency domain down mixing capable ofswitching between time domain and frequency domain coding of the primaryY and secondary X channels.

A first variant of such method and system is shown in FIG. 17, which isa block diagram illustrating concurrently stereo encoding method andsystem using time-domain down-switching with a capability of operatingin the time-domain and in the frequency domain.

In FIG. 17, the stereo encoding method and system includes manypreviously described operations and modules described with reference toprevious figures and identified by the same reference numerals. Adecision module 1751 (decision operation 1701) determines whether leftL′ and right R′ channels from the temporal delay corrector 1750 shouldbe encoded in the time domain or in the frequency domain. If time domaincoding is selected, the stereo encoding method and system of FIG. 17operates substantially in the same manner as the stereo encoding methodand system of the previous figures, for example and without limitationas in the embodiment of FIG. 15.

If the decision module 1751 selects frequency coding, atime-to-frequency converter 1752 (time-to-frequency converting operation1702) converts the left L′ and right R′ channels to frequency domain. Afrequency domain down mixer 1753 (frequency domain down mixing operation1703) outputs primary Y and secondary X frequency domain channels. Thefrequency domain primary channel is converted back to time domain by afrequency-to-time converter 1754 (frequency-to-time converting operation1704) and the resulting time domain primary channel Y is applied to theprimary channel encoder 252/352. The frequency domain secondary channelX from the frequency domain down mixer 1753 is processed through aconventional parametric and/or residual encoder 1755 (parametric and/orresidual encoding operation 1705).

FIG. 18 is a block diagram illustrating concurrently other stereoencoding method and system using frequency domain down mixing with acapability of operating in the time-domain and in the frequency domain.In FIG. 18, the stereo encoding method and system are similar to thestereo encoding method and system of FIG. 17 and only the new operationsand modules will be described.

A time domain analyzer 1851 (time domain analyzing operation 1801)replaces the earlier described time domain channel mixer 251/351 (timedomain down mixing operation 201/301). The time domain analyzer 1851includes most of the modules of FIG. 4, but without the time domain downmixer 456. Its role is thus in a large part to provide a calculation ofthe factor β. This factor β is supplied to the pre-processor 851 and tofrequency-to-time domain converters 1852 and 1853 (frequency-to-timedomain converting operations 1802 and 1803) that respectively convert totime domain the frequency domain secondary X and primary Y channelsreceived from the frequency domain down mixer 1753 for time domainencoding. The output of the converter 1852 is thus a time domainsecondary channel X that is provided to the preprocessor 851 while theoutput of the converter 1852 is a time domain primary channel Y that isprovided to both the preprocessor 1551 and the encoder 252/352.

6) Example Hardware Configuration

FIG. 12 is a simplified block diagram of an example configuration ofhardware components forming each of the above described stereo soundencoding system and stereo sound decoding system.

Each of the stereo sound encoding system and stereo sound decodingsystem may be implemented as a part of a mobile terminal, as a part of aportable media player, or in any similar device. Each of the stereosound encoding system and stereo sound decoding system (identified as1200 in FIG. 12) comprises an input 1202, an output 1204, a processor1206 and a memory 1208.

The input 1202 is configured to receive the left L and right R channelsof the input stereo sound signal in digital or analog form in the caseof the stereo sound encoding system, or the bitstream 1001 in the caseof the stereo sound decoding system. The output 1204 is configured tosupply the multiplexed bitstream 207/307 in the case of the stereo soundencoding system or the decoded left channel L′ and right channel R′ inthe case of the stereo sound decoding system. The input 1202 and theoutput 1204 may be implemented in a common module, for example a serialinput/output device.

The processor 1206 is operatively connected to the input 1202, to theoutput 1204, and to the memory 1208. The processor 1206 is realized asone or more processors for executing code instructions in support of thefunctions of the various modules of each of the stereo sound encodingsystem as shown in FIGS. 2, 3, 4, 8, 9, 13, 14, 15, 16, 17 and 18 andthe stereo sound decoding system as shown in FIGS. 10 and 11.

The memory 1208 may comprise a non-transient memory for storing codeinstructions executable by the processor 1206, specifically, aprocessor-readable memory comprising non-transitory instructions that,when executed, cause a processor to implement the operations and modulesof the stereo sound encoding method and system and the stereo sounddecoding method and system as described in the present disclosure. Thememory 1208 may also comprise a random access memory or buffer(s) tostore intermediate processing data from the various functions performedby the processor 1206.

Those of ordinary skill in the art will realize that the description ofthe stereo sound encoding method and system and the stereo sounddecoding method and system are illustrative only and are not intended tobe in any way limiting. Other embodiments will readily suggestthemselves to such persons with ordinary skill in the art having thebenefit of the present disclosure. Furthermore, the disclosed stereosound encoding method and system and stereo sound decoding method andsystem may be customized to offer valuable solutions to existing needsand problems of encoding and decoding stereo sound.

In the interest of clarity, not all of the routine features of theimplementations of the stereo sound encoding method and system and thestereo sound decoding method and system are shown and described. Itwill, of course, be appreciated that in the development of any suchactual implementation of the stereo sound encoding method and system andthe stereo sound decoding method and system, numerousimplementation-specific decisions may need to be made in order toachieve the developer's specific goals, such as compliance withapplication-, system-, network- and business-related constraints, andthat these specific goals will vary from one implementation to anotherand from one developer to another. Moreover, it will be appreciated thata development effort might be complex and time-consuming, but wouldnevertheless be a routine undertaking of engineering for those ofordinary skill in the field of sound processing having the benefit ofthe present disclosure.

In accordance with the present disclosure, the modules, processingoperations, and/or data structures described herein may be implementedusing various types of operating systems, computing platforms, networkdevices, computer programs, and/or general purpose machines. Inaddition, those of ordinary skill in the art will recognize that devicesof a less general purpose nature, such as hardwired devices, fieldprogrammable gate arrays (FPGAs), application specific integratedcircuits (ASICs), or the like, may also be used. Where a methodcomprising a series of operations and sub-operations is implemented by aprocessor, computer or a machine and those operations and sub-operationsmay be stored as a series of non-transitory code instructions readableby the processor, computer or machine, they may be stored on a tangibleand/or non-transient medium.

Modules of the stereo sound encoding method and system and the stereosound decoding method and decoder as described herein may comprisesoftware, firmware, hardware, or any combination(s) of software,firmware, or hardware suitable for the purposes described herein.

In the stereo sound encoding method and the stereo sound decoding methodas described herein, the various operations and sub-operations may beperformed in various orders and some of the operations andsub-operations may be optional.

Although the present disclosure has been described hereinabove by way ofnon-restrictive, illustrative embodiments thereof, these embodiments maybe modified at will within the scope of the appended claims withoutdeparting from the spirit and nature of the present disclosure.

REFERENCES

The following references are referred to in the present specificationand the full contents thereof are incorporated herein by reference.

-   [1] 3GPP TS 26.445, v. 12.0.0, “Codec for Enhanced Voice Services    (EVS); Detailed Algorithmic Description”, September 2014.-   [2] M. Neuendorf, M. Multrus, N. Rettelbach, G. Fuchs, J.    Robillard, J. Lecompte, S. Wilde, S. Bayer, S. Disch, C.    Helmrich, R. Lefevbre, P. Gournay, et al., “The ISO/MPEG Unified    Speech and Audio Coding Standard—Consistent High Quality for All    Content Types and at All Bit Rates”, J. Audio Eng. Soc., vol. 61,    no. 12, pp. 956-977, December 2013.-   [3] B. Bessette, R. Salami, R. Lefebvre, M. Jelinek, J.    Rotola-Pukkila, J. Vainio, H. Mikkola, and K. Järvinen, “The    Adaptive Multi-Rate Wideband Speech Codec (AMR-WB),” Special Issue    of IEEE Trans. Speech and Audio Proc., Vol. 10, pp. 620-636,    November 2002.-   [4] R. G. van der Waal & R. N. J. Veldhuis, “Subband coding of    stereophonic digital audio signals”, Proc. IEEE ICASSP, Vol. 5, pp.    3601-3604, April 1991-   [5] Dai Yang, Hongmei Ai, Chris Kyriakakis and C.-C. Jay Kuo,    “High-Fidelity Multichannel Audio Coding With Karhunen-Loeve    Transform”, IEEE Trans. Speech and Audio Proc., Vol. 11, No. 4, pp.    365-379, July 2003.-   [6] J. Breebaart, S. van de Par, A. Kohlrausch and E. Schuijers,    “Parametric Coding of Stereo Audio”, EURASIP Journal on Applied    Signal Processing, Issue 9, pp. 1305-1322, 2005-   [7] 3GPP TS 26.290 V9.0.0, “Extended Adaptive Multi-Rate—Wideband    (AMR-WB+) codec; Transcoding functions (Release 9)”, September 2009.-   [8] Jonathan A. Gibbs, “Apparatus and method for encoding a    multi-channel audio signal”, U.S. Pat. No. 8,577,045 B2

What is claimed is:
 1. A method for encoding stereo sound in response toan input stereo sound signal including left and right channels,comprising: determining a normalised correlation of the left channel anda normalised correlation of the right channel in relation to amonophonie signal version of the sound; determining a long-termcorrelation difference on the basis of the normalised correlation of theleft channel and the normalised correlation of the right channel;converting the long-term correlation difference into a factor β, wherein0≤β≤1; producing primary and secondary channels from the left and rightchannels of the stereo sound signal; and encoding the primary channelfor producing a primary channel encoded bitstream and encoding thesecondary channel for producing a secondary channel encoded bitstream,wherein encoding the primary channel and encoding the secondary channelcomprise distributing a bit budget between encoding of the primarychannel and encoding of the secondary channel using the factor β;wherein the primary channel encoded bitstream and the secondary channelencoded bitstream form an encoded version of the stereo sound.
 2. Astereo sound encoding method as defined in claim 1, comprising:determining an energy of each of the left and right channels;determining a long-term energy value of the left channel using theenergy of the left channel and a long-term energy value of the rightchannel using the energy of the right channel; and determining a trendof the energy in the left channel using the long-term energy value ofthe left channel and a trend of the energy in the right channel usingthe long-term energy value of the right channel.
 3. A stereo soundencoding method as defined in claim 2, wherein determining the long-termcorrelation difference comprises: smoothing the normalized correlationsof the left and right channels using a speed of convergence of thelong-term correlation difference determined using the trends of theenergies in the left and right channels; and using the smoothednormalized correlations to determine the long-term correlationdifference.
 4. A stereo sound encoding method as defined in claim 1,wherein converting the long-term correlation difference into a factor βcomprises: linearizing the long-term correlation difference; and mappingthe linearized long-term correlation difference into a given function toproduce the factor β.
 5. A stereo sound encoding method as defined inclaim 1, wherein the primary channel is formed by the right channel andthe secondary channel is formed by the left channel.
 6. A stereo soundencoding method as defined in claim 1, wherein the primary channel isformed by the left channel and the secondary channel is formed by theright channel.
 7. A stereo sound encoding method as defined in claim 1,comprising, when time-domain correction (TDC) is not used, increasingthe emphasis on the secondary channel when the factor β is close to 0.5and decreasing the emphasis on the secondary channel when the factor βis close to 1.0 or 0.0.
 8. A stereo sound encoding method as defined inclaim 1, comprising, when time-domain correction (TDC) is used,decreasing the emphasis on the secondary channel when the factor β isclose to 0.5 and increasing the emphasis on the secondary channel whenthe factor β is close to 1.0 or 0.0.
 9. A stereo sound encoding methodas defined in claim 1, comprising applying a pre-adaptation factordirectly to the normalized correlations of the left and right channelsprior to determining the long-term correlation difference.
 10. A stereosound encoding method as defined in claim 9, comprising calculating thepre-adaptation factor in response to (a) long term left and rightchannel energy values, (b) a frame classification of previous frames,and (c) voice activity information from the previous frames.
 11. Aprocessor-readable memory storing non-transitory instructions that, whenexecuted, cause a processor to implement the operations of the method asrecited in claim
 1. 12. A system for encoding stereo sound in responseto an input stereo sound signal comprising left and right channels,comprising: at least one processor; and a memory coupled to theprocessor and storing non-transitory instructions that when executedcause the processor to implement: a normalised correlation analyzer fordetermining a normalised correlation of the left channel and anormalised correlation of the right channel in relation to a monophonicsignal version of the sound; a calculator of a long-term correlationdifference on the basis of the normalised correlation of the leftchannel and the normalised correlation of the right channel; a converterof the long-term correlation difference into a factor β, wherein 0≤β≤1;a producer of primary and secondary channels from the left and rightchannels of the input stereo sound signal; and an encoder of the primarychannel for producing a primary channel encoded bitstream and an encoderof the secondary channel for producing a secondary channel encodedbitstream, wherein the primary channel encoder and the secondary channelencoder comprise a distributor of a bit budget between encoding of theprimary channel and encoding of the secondary channel using the factorβ; wherein the primary channel encoded bitstream and the secondarychannel encoded bitstream form an encoded version of the stereo sound.13. A stereo sound encoding system as defined in claim 12, comprising:an energy analyzer for determining (a) an energy of each of the left andright channels, and (b) a long-term energy value of the left channelusing the energy of the left channel and a long-term energy value of theright channel using the energy of the right channel; and an energy trendanalyzer for determining a trend of the energy in the left channel usingthe long-term energy value of the left channel and a trend of the energyin the right channel using the long-term energy value of the rightchannel.
 14. A stereo sound encoding system as defined in claim 13,wherein the calculator of the long-term correlation difference: smoothesthe normalized correlations of the left and right channels using a speedof convergence of the long-term correlation difference determined usingthe trends of the energies in the left and right channels; and uses thesmoothed normalized correlations to determine the long-term correlationdifference.
 15. A stereo sound encoding system as defined in claim 12,wherein the converter of the long-term correlation difference into afactor β: linearizes the long-term correlation difference; and maps thelinearized long-term correlation difference into a given function toproduce the factor β.
 16. A stereo sound encoding system as defined inclaim 12, wherein the primary channel is formed by the right channel andthe secondary channel is formed by the left channel.
 17. A stereo soundencoding system as defined in claim 12, wherein the primary channel isformed by the left channel and the secondary channel is formed by theright channel.
 18. A stereo sound encoding system as defined in claim12, comprising means for, when time-domain correction (TDC) is not used,increasing the emphasis on the secondary channel when the factor β isclose to 0.5 and decreasing the emphasis on the secondary channel whenthe factor β is close to 1.0 or 0.0.
 19. A stereo sound encoding systemas defined in claim 12, comprising means for, when time-domaincorrection (TDC) is used, decreasing the emphasis on the secondarychannel when the factor β is close to 0.5 and increasing the emphasis onthe secondary channel when the factor β is close to 1.0 or 0.0.
 20. Astereo sound encoding system as defined in claim 12, comprising apre-adaptation factor calculator for applying a pre-adaptation factordirectly to the normalized correlations of the left and right channelsprior to determining the long-term correlation difference.
 21. A stereosound encoding system as defined in claim 20, wherein the preadaptationfactor calculator calculates the pre-adaptation factor in response to(a) long term left and right channel energy values, (b) a frameclassification of previous frames, and (c) voice activity informationfrom the previous frames.
 22. A system for encoding stereo sound inresponse to an input stereo sound signal comprising left and rightchannels, comprising: a normalised correlation analyzer for determininga normalised correlation of the left channel and a normalisedcorrelation of the right channel in relation to a monophonic signalversion of the sound; a calculator of a long-term correlation differenceon the basis of the normalised correlation of the left channel and thenormalised correlation of the right channel; a converter of thelong-term correlation difference into a factor β, wherein 0≤β≤1; aproducer of primary and secondary channels from the left and rightchannels of the input stereo sound signal; and an encoder of the primarychannel for producing a primary channel encoded bitstream and an encoderof the secondary channel for producing a secondary channel encodedbitstream, wherein the primary channel encoder and the secondary channelencoder comprise a distributor of a bit budget between encoding of theprimary channel and encoding of the secondary channel using the factorβ; wherein the primary channel encoded bitstream and the secondarychannel encoded bitstream form an encoded version of the stereo sound.23. A system for encoding stereo sound in response to an input stereosound signal comprising left and left channels, comprising: at least oneprocessor; and a memory coupled to the processor and storingnon-transitory instructions that when executed cause the processor to:determine a normalised correlation of the left channel and a normalisedcorrelation of the right channel in relation to a monophonic signalversion of the sound; calculate a long-term correlation difference onthe basis of the normalised correlation of the left channel and thenormalised correlation of the right channel; convert the long-termcorrelation difference into a factor β, wherein 0≤β≤1; produce primaryand secondary channels from the left and right channels of the inputstereo sound signal; and encode, using a primary channel encoder, theprimary channel for producing a primary channel encoded bitstream andencode, using a secondary channel encoder, the secondary channel forproducing a secondary channel encoded bitstream, wherein the primarychannel encoder and the secondary channel encoder distribute a bitbudget between encoding of the primary channel and encoding of thesecondary channel using the factor β; wherein the primary channelencoded bitstream and the secondary channel encoded bitstream form anencoded version of the stereo sound.
 24. A stereo sound encoding systemas defined in claim 23, wherein the processor: determines (a) an energyof each of the left and right channels, and (b) a long-term energy valueof the left channel using the energy of the left channel and a long-termenergy value of the right channel using the energy of the right channel;and determines a trend of the energy in the left channel using thelong-term energy value of the left channel and a trend of the energy inthe right channel using the long-term energy value of the right channel.25. A stereo sound encoding system as defined in claim 24, wherein, tocalculate the long-term correlation difference, the processor: smoothesthe normalized correlations of the left and right channels using a speedof convergence of the long-term correlation difference determined usingthe trends of the energies in the left and right channels; and uses thesmoothed normalized correlations to determine the long-term correlationdifference.
 26. A stereo sound encoding system as defined in claim 23,wherein, to convert the long-term correlation difference into a factorβ, the processor: linearizes the long-term correlation difference; andmaps the linearized long-term correlation difference into a givenfunction to produce the factor β.
 27. A stereo sound encoding system asdefined in claim 23, wherein the primary channel is formed by the rightchannel and the secondary channel is formed by the left channel.
 28. Astereo sound encoding system as defined in claim 23, wherein the primarychannel is formed by the left channel and the secondary channel isformed by the right channel.
 29. A stereo sound encoding system asdefined in claim 23, wherein, when time-domain correction (TDC) is notused, the processor increases the emphasis on the secondary channel whenthe factor β is close to 0.5 and decreases the emphasis on the secondarychannel when the factor β is close to 1.0 or 0.0.
 30. A stereo soundencoding system as defined in claim 23, wherein, when time-domaincorrection (TDC) is used, the processor decreases the emphasis on thesecondary channel when the factor β is close to 0.5 and increases theemphasis on the secondary channel when the factor β is close to 1.0 or0.0.
 31. A stereo sound encoding system as defined in claim 23, whereinthe processor applies a pre-adaptation factor directly to the normalizedcorrelations of the left and right channels prior to determining thelong-term correlation difference.
 32. A stereo sound encoding system asdefined in claim 31, wherein the processor calculates the pre-adaptationfactor in response to (a) long term left and right channel energyvalues, (b) a frame classification of previous frames, and (c) voiceactivity information from the previous frames.